我正在尝试编写一个htaccess代码来重定向到特定页面。但它现在不起作用。请参阅完整的htaccess代码
RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)/([\w.,]+)/([\w.,]+)/([\w.,]+)/([\w.,]+)/([\w.,]+)/([\w.,]+)$ job.php?j=$1
RewriteRule ^([a-zA-Z0-9]+)/([\w.,]+)/([0-9]+)$ sameIndustryJobs.php?i=$1&c=$2&p=$3
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([\w',]+)/([0-9]+)$ sameCatagoryJobs.php?c=$1&s=$3&p=$4
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([\w.,]+)/([0-9]+)$ sameCityJobs.php?c=$1&cn=$4&p=$5
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([\w.,]+)/([0-9]+)$ sameQualificationJobs.php?q=$1&cn=$5&p=$6
ErrorDocument 401 sorry.php
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
答案 0 :(得分:1)
您应该将[L]
放在每个RewriteRule行的末尾。标记L
表示最后一个表示Apache规则的结束。