开发者

.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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜