0

我正在尝试编写一个 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
4

1 回答 1

1

你应该把[L]你拥有的每一行 RewriteRule 放在最后。FlagL表示 Last,它向 Apache 指示规则的结束。

于 2012-05-25T11:38:42.267 回答