title: Using mod_rewrite to hide all PHP extensions (incl. subdirectories)
body: <p>I am trying to hide the php extension at the end of a url for a site using mod_rewrite. The site has the following content:</p>
  
  <pre><code>/index.php
  /news.php
  /about/index.php
  /about/contact.php
  </code></pre>
  
  <p>I would like the following to work:</p>
  
  <pre><code>http://domain.com/news
  http://domain.com/about
  http://domain.com/about/contact
  </code></pre>
  
  <p>Right now I am using the following rewrite, but it isn't working for sub-directories</p>
  
  <pre><code>Options +FollowSymlinks
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ $1.php
  </code></pre>
  
  <p>TIA.</p>