ErrorDocument和错误301

时间:2012-02-29 13:10:01

标签: apache .htaccess http-status-code-301

htaccess我有这样的代码

ErrorDocument 404 http://www.xxx.com/410.html

它重定向到410.php页面,错误为302

我希望被重定向到此页面,错误301

同一文件410.php

header ("HTTP/1.0 410 Gone");
The requested page has been removed.

我该怎么做?

1 个答案:

答案 0 :(得分:1)

我认为您根本不应该重定向:您只是希望该页面提供原始错误代码,不是吗? (即404或410)

这可以通过使用相对路径而不是完整的URL来实现:

ErrorDocument 404 /410.html
相关问题