title: mod rewrite recursion
body: <p>I'm trying to understand why I get an internal server error with this in my .htaccess file:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine on 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME}\.php -f 
    RewriteRule ^(.*?)(/)?$ $1.php
    Options +FollowSymlinks
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I'm attempting to direct URI's like /about/ and /work/ to about.php and work.php</p>
  
  <p>Here's an example of when I get a 500 error:</p>
  
  <p>I visit example.com/about/probablydoesntexist</p>
  
  <p>I looked at the rewrite log and I can see it keeps trying like so:</p>
  
  <p>about/probablydoesntexist.php
  about/probablydoesntexist.php.php
  about/probablydoesntexist.php.php.php and so on. </p>
  
  <p>Why isn't it meeting the RewriteCond of that php file not exisiting?</p>
  
  <p>How do I prevent the recursion?</p>