.htaccess 404页返回200 ok

.htaccess 404页返回200 ok,.htaccess,error-handling,http-status-code-404,.htaccess,Error Handling,Http Status Code 404,如果我直接在浏览器栏中键入www.mydomain/error404.html,它应该返回404响应还是200 ok 如果我键入www.mydomain.co.uk/something-that-dosent-exist.html,它将返回404页面,正确状态为404,但是我的实际404.html页面是否应返回200ok 领域 错误文档error404.html htaccess AddType x-mapp-php4 .htm #turn off the smart spelling m

如果我直接在浏览器栏中键入www.mydomain/error404.html,它应该返回404响应还是200 ok

如果我键入www.mydomain.co.uk/something-that-dosent-exist.html,它将返回404页面,正确状态为404,但是我的实际404.html页面是否应返回200ok

领域

错误文档error404.html


htaccess

AddType x-mapp-php4 .htm

#turn off the smart spelling matching feature.
CheckSpelling off

#set your real error document, which can be a php document.
ErrorDocument 404 /error404.html

主机是1和1共享主机


为任何帮助干杯,李

我希望它能回报200英镑。您的页面(尽管它名为404,并被用作重定向404页面)存在,并且已正确找到并提供服务

是的,没错。如果您要访问世界上任何一个可访问的站点,并且您的浏览器成功地获取了该页面,那么您应该返回200 OK


通常,您不会将错误页面保存在用户可以直接访问的位置。您通常会在内部重定向到服务器上的错误页面

那么,你想让它退回什么呢?您可以使用
标题
功能设置返回的状态。