Making a rewriterule remove .php extension?
Posted
by Sam
on Stack Overflow
See other posts from Stack Overflow
or by Sam
Published on 2009-04-23T13:34:09Z
Indexed on
2010/06/07
22:02 UTC
Read the original article
Hit count: 268
.htaccess
|rewriterule
Hello, I have come up with a rewriterule to to go to any page on my website without typing in the .php extension because it is automatically added to the url.
The rule is: RewriteRule ^(\w+)/?$ /$1.php
It takes anything you type in my index and adds .php to it, so you can put in http://sampardee.com/index and it pulls up index.php
Now my question is how to detect when a user enters http://sampardee.com/index.php and change it to http://sampardee.com/index
How could I do so with a rewriterule?
© Stack Overflow or respective owner