开发者

What's wrong with this Apache rewrite rule?

开发者 https://www.devze.com 2023-03-18 02:08 出处:网络
Here\'s my .htaccess: 开发者_如何学CRewriteEngine On RewriteRule ^([^/]+)$ /index.php?id=$1 [L] And requests keep causing a 500.You are entering rewrite loop. Change it like this:

Here's my .htaccess:

开发者_如何学C
RewriteEngine On
RewriteRule ^([^/]+)$ /index.php?id=$1 [L]

And requests keep causing a 500.


You are entering rewrite loop. Change it like this:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/index\.php [NC]
RewriteRule ^([^/]+)$ /index.php?id=$1 [QSA,L]

or like this (should have the same effect behind):

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)$ /index.php?id=$1 [QSA,L]
0

精彩评论

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

关注公众号