title: Apache ReWriteEngine throwing 500 Internal Server Error for too many internal redirects... why?
body: <p>I'm trying to implement a new ReWrite rule on my local dev machine.  I have 13 rules set up already, and all work fine (even as of this writing).  However, for some reason the newest one is throwing me 500 Internal Server Errors.  </p>
  
  <p>The ReWrite rule is:</p>
  
  <pre><code>RewriteRule stuff/public_html/vault/mystuff/view/(.*) /stuff/public_html/vault/mystuff/view/index.php?stuff=$1
  
  RewriteRule stuff/public_html/vault/mystuff/view/(.*)/ /stuff/public_html/vault/mystuff/view/index.php?stuff=$1
  </code></pre>
  
  <p>Checked my apache logs and got this:</p>
  
  <pre><code>[Thu Jan 13 22:07:43 2011] [error] [client ::1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost:8888/stuff/public_html/vault/mystuff/all/index.php?curr=7
  </code></pre>
  
  <p>On the script I am trying to redirect to view/index.php?stuff=$1, there is nothing that even remotely resembles a redirect of any kind.  I do have a very, very basic session verifier being called at the top of the landing script, which is as follows:</p>
  
  <pre><code>//Start session
   session_start();
  
   //Check whether the session variable SESS_MEMBER_ID is present or not
   if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
    header("location: ".$root_http."");
    exit();
   }
  </code></pre>
  
  <p>However, when I access the page directly, it acts as it should, and there is no redirect.  All of my other ReWrite rules and their corresponding landing pages are set up the exact same way.</p>
  
  <p>This is blowing my mind.  Any help, PLEASE!?</p>
  
  <p>On suggestion from Marc B I turned on RewriteLog, and came up with this:</p>
  
  <p>::1 - - [13/Jan/2011:23:00:09 --0500] [localhost/sid#807df8][rid#941b38/initial/redir#10] (2) [per-dir /Users/stepheng/Development/] rewrite stuff/public_html/vault/mystuff/view/index.php -> /stuff/public_html/vault/mystuff/view/index.php?stuff=index.php</p>
  
  <p>::1 - - [13/Jan/2011:23:00:09 --0500] [localhost/sid#807df8][rid#941b38/initial/redir#10] (3) split uri=/stuff/public_html/vault/mystuff/view/index.php?stuff=index.php -> uri=/stuff/public_html/vault/mystuff/view/index.php, args=stuff=index.php</p>
  
  <p>::1 - - [13/Jan/2011:23:00:09 --0500] [localhost/sid#807df8][rid#941b38/initial/redir#10] (3) [per-dir /Users/stepheng/Development/] applying pattern 'stuff/public_html/vault/mystuff/view/(.*)/' to uri '/stuff/public_html/vault/mystuff/view/index.php'</p>
  
  <p>::1 - - [13/Jan/2011:23:00:09 --0500] [localhost/sid#807df8][rid#941b38/initial/redir#10] (1) [per-dir /Users/stepheng/Development/] internal redirect with /stuff/public_html/vault/mystuff/view/index.php [INTERNAL REDIRECT]</p>
  
  <p>It looks like it's trying to send the argument ?stuff=index.php, but I don't see how that's possible.  Any ideas?</p>