开发者

.htaccess rewrite rule: i cant access folders, only php files

RewriteEngine On
RewriteRule ^([^\.]+)$ $1.php [QSA]

Well this is meant to remove the php extension and to find /login and match it with /login.php for example

It is working fine, but when i need t开发者_运维百科o enter a folder /something it tries to match it with /something.php so i get a 404 error.

How can I make this rule to let me accesss folders too?

thanks in advance


Try this:

RewriteRule ^login(/?|/.*)$ /login.php [QSA]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜