URL mod重写响应500内部服务器错误


URL mod rewriting response 500 Internal Server Error

我正在尝试重写我的网站URL,这给了我错误"500内部服务器错误"。这是我的代码

RewriteEngine On
RewriteRule ^index$ /index.php [L]
RewriteRule ^([^/]*)$ /index.php?shopiId=5&shopName=$1 [L]

请帮忙。

试试这个。

RewriteEngine On
RewriteRule ^index$ index.php [L,QSA]
RewriteRule ^([^/]*)$ index.php?shopiId=5&shopName=$1 [L,QSA]

不要开始用a/分段,因为你不喜欢引用一条绝对的路径。这实际上意味着/index.php如果你只是在不带前导/的情况下写它,它的意思就像/var/www/index.php

在一个无穷大的循环中,你得到了500个错误。

另外,你需要添加QSA标志,否则你会得到index.php作为shopName

http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_qsa