0

我正在尝试使用 .htaccess 中的重定向重定向到自定义错误页面。请查看网站 jobslanda.com。线路ErrorDocument 401 401.php不工作。我在 .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 401.php

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
4

2 回答 2

0

您的网络服务器上的 401.php 文件在哪里?通常,该ErrorDocument指令应以 a 开头/并引用相对于您的 Web 根目录的页面。

参考: http ://httpd.apache.org/docs/2.0/mod/core.html#errordocument

您似乎在以下位置没有页面: http://jobslanda.com/401.php

奇怪的是,这302会将重定向返回到名为404.php.

于 2012-05-28T18:55:29.403 回答
0

是因为您没有正确拼写“.htaccess”吗?(并且您的 Apache 安装没有拾取文件?)

于 2012-05-27T07:51:10.257 回答