title: How can I use a .htaccess rewrite to a page that has a php header redirect?
body: <p>this is my first post so go easy on me.</p>
  
  <p>Basically I am doing some rewrites in my htaccess file to change my made up search friendly URLs into actual URLs, and for the most part they are working.  For instance this:</p>
  
  <p><a href="http://www.negativeworld.org/7849/news/nintendo-download-for-may-24-2012" rel="nofollow">http://www.negativeworld.org/7849/news/nintendo-download-for-may-24-2012</a></p>
  
  <p>Will turn into this:</p>
  
  <p><a href="http://www.negativeworld.org/article.php?id=7849" rel="nofollow">http://www.negativeworld.org/article.php?id=7849</a></p>
  
  <p>Just fine... IF that article exists.  If the article doesn't exist, the php code uses this:</p>
  
  <pre><code>header("Location: boarderror.php");
  exit;
  </code></pre>
  
  <p>To bring the user to boarderror.php.  This works fine if it the user gets there directly on article.php and the id is bad, but when I am trying to do the htaccess redirect from a search friendly url and the id is bad, the htaccess redirect just hangs for awhile before giving me this message: "The page isn't redirecting properly".</p>
  
  <p>What I want is for it to go to my boarderror.php page when there is a bad id.  So basically I want my htaccess page to take a server friendly URL, switch to the true URL, and well... just let go at that point, and the PHP will take it from there.  Here is my htaccess line that does the switch:</p>
  
  <pre><code>RewriteRule ^([0-9]+)/(news|review|editorial|podcast)/(.*)$ /article.php?id=$1 [L]
  </code></pre>
  
  <p>What am I doing wrong?  (BTW I realize that if I set up all of my search friendly URLs correctly there should never be a bad id anyway, but I want to be on the safe side...)</p>