404页面返回200 OK
问题描述:
如果我直接输入www.mydomain/error404.html到浏览器栏,它应该返回一个404响应还是200正确?404页面返回200 OK
如果我输入www.mydomain.co.uk/something-that-dosent-exist.html,它会返回404页面,其状态正确为404,但是我的实际404.html页面返回200ok?
http://gsitecrawler.com/tools/Server-Status.aspx
错误文档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
宿主是SH的1and1 ARED托管
欢呼声李的帮助
答
我希望它返回一个200你的页面(即使它命名为404,并且被用作您的重定向404页)存在,并发现和正确服务。
答
是的,这是正确的。如果你要去任何世界可访问的网站,并且你的浏览器成功地获得了该页面,你应该返回200 OK。
通常,您不会将错误页面保存在用户可以直接访问的位置。您通常会在内部重定向到服务器上的错误页面。
那么,你想要它返回什么?您可以使用'header'函数设置返回的状态。 – 2011-03-29 17:47:15