【发布时间】:2015-10-03 00:34:03
【问题描述】:
我的网站最多可以接受四个参数,因此我将以下内容添加到我的 .htaccess 中。
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ /index.php?atr=$1&dir=$2&query=$3&lookup=$4 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?atr=$1&dir=$2&query=$3 [L]
RewriteRule ^([^/]*)/([^/]*)$ /index.php?atr=$1&dir=$2 [L]
RewriteRule ^([^/]*)$ /index.php?atr=$1 [L]
在我添加第五行以仅允许一个参数之前,一切正常。这会在 index.php 的所有实例中返回 500 个错误,错误如下:
Request exceeded the limit of 10 internal redirects
【问题讨论】:
-
第五条规则是什么?
-
@hjpotter92 抱歉,我有点混淆了,我指的是第五行,第四条规则。
标签: .htaccess mod-rewrite url-rewriting friendly-url