Hopefully a quick URL rewrite question for you all.
I've got a page on my site: http://www.sample.com/whatever.php
and i'd like to be able to navigate the site without typing .php
so http://www.sample.com/whatever would show the same thing.
I'd like this to work for any file in the root directory, so users could use the extension or not.
Any thoughts?
As suggested in the comments above, I solved this issue using Apache's MultiViews
Adding the following to my .htaccess file did the trick:
Options +MultiViews
AddType application/x-httpd-php .php
Update: More details here: http://www.bmt-online.org/geekisms/php-multiviews
I'd say this should do it
htcaccess:
RewriteEngine on
RewriteBase /
RewriteRule whatever$ whatever.php
精彩评论