由于可能的配置,请求超出了10个内部重定向的限制

时间:2016-02-24 16:48:52

标签: php apache .htaccess

我的.htaccess规则看起来像这样

RewriteEngine On
RewriteBase /
RewriteRule ^main index.php [L]
RewriteRule ^login login.php [L]
RewriteRule ^logout logout.php [L]
RewriteRule ^tags tags.php [L]
RewriteRule ^audios/([^/]*)$ audios.php?type=$1 [L]
RewriteRule ^audios/([^/]*)/page([^/]*)$ audios.php?type=$1&page=$2 [L]
RewriteRule ^audios/([^/]*)/([^/]*)$ audios.php?type=$1&timesort=$2 [L]
RewriteRule ^audios/([^/]*)/([^/]*)/page([^/]*)$ audios.php?type=$1&timesort=$2&page=$3 [L]

每次访问这些页面时都会出现500内部错误。只有页面工作是index.php

任何想法?

1 个答案:

答案 0 :(得分:1)

尝试使用结束锚的这些规则:

Options -MultiViews
RewriteEngine On
RewriteBase /

RewriteRule ^main/?$ index.php [L]
RewriteRule ^login/?$ login.php [L]
RewriteRule ^logout/?$ logout.php [L]
RewriteRule ^tags/?$ tags.php [L]

RewriteRule ^audios/([^/]+)/?$ audios.php?type=$1 [L,QSA]
RewriteRule ^audios/([^/]+)/page([^/]*)$ audios.php?type=$1&page=$2 [L,QSA]
RewriteRule ^audios/([^/]+)/([^/]*)$ audios.php?type=$1&timesort=$2 [L,QSA]
RewriteRule ^audios/([^/]+)/([^/]+)/page([^/]*)$ audios.php?type=$1&timesort=$2&page=$3 [L,QSA]