title: htaccess: remove extension, and redirect to index.php?p=<page>
body: <pre><code>RewriteRule ^([a-zA-Z0-9]+)?$ index.php?page=$1 [L]
  </code></pre>
  
  <p>I've got the previous code that rewrites  ex: domain.com/about to domain.com/index.php?page=about</p>
  
  <p>So now, I want to add a measure of safety to that just in case someone adds .html or .php to the end thinking it should be there, I want it to remove the extension, but still follow my previous rule.  I want this change to ignore if the file actually exists.  If the file exists, it needs to still process the ending.</p>
  
  <p>ex:</p>
  
  <p>if someone types in about.php or about.html, I want it to remove the extension, and then process whats left to the rewrite rule above.</p>
  
  <p>So about.php will rewrite to about and then rewrite to index.php?page=about</p>
  
  <p>If at all possible, I'd like for it to actually change the URL to domain.com/about.  Right now, the above rewrite leaves the domain.com/about but just processes it through index.php.  I would love it if they enter about.php or about.html it would redirect the browser to domain.com/about .</p>
  
  <p>Any way possible to achieve this?  I've looked around at removing file extension with htaccess, but none of them do what I want with redirecting to index.php?page=.  They all want to redirect differently.</p>
  
  <h2>EDIT</h2>
  
  <p>I need this to be universal.  It can't just process 'about', I need it to process anything in that specific spot.</p>