开发者

What's wrong with this Apache rewrite rule?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜