开发者

Rewrite .htaccess regex url

I have an .htaccess file with this: (I didn't write it)

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?b开发者_StackOverflow中文版la=$1 [L,QSA]

Problem URL http://localhost/index/test The "index" part seems to match "index.php" that's in a web dir and Rewrite fails.

Question: What's wrong and how do I fix it?


The enabled option MultiViews could cause this behavior. Try to disable it:

Options -MultiViews


Try with:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^(.*)$ index.php?bla=$1 [L,QSA]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜