开发者

Rewrite .htaccess regex url

开发者 https://www.devze.com 2022-12-18 12:47 出处:网络
I have an .htaccess file with this: (I didn\'t write it) RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f

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

精彩评论

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