.htaccess rewrite question
How would I change
http://website.com/file.php
to
http://开发者_开发技巧website.com/file/
thanks.
In most apache server deployments, you can create a .htaccess on the document root containing:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1.php
This will work as long as "file" does not match any existing directory.
精彩评论