我的.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×ort=$2 [L]
RewriteRule ^audios/([^/]*)/([^/]*)/page([^/]*)$ audios.php?type=$1×ort=$2&page=$3 [L]
每次访问这些页面时都会出现500内部错误。只有页面工作是index.php
任何想法?
答案 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×ort=$2 [L,QSA]
RewriteRule ^audios/([^/]+)/([^/]+)/page([^/]*)$ audios.php?type=$1×ort=$2&page=$3 [L,QSA]