让404页面返回正确的http status
日期:2011-08-10 阅读:43 分类:综合信息
一般虚拟主机都支持自定义404文件,但如果我们仅仅是指定一个文件之后,就万事大吉了么?
其实不是这样的,通过firefox插件httpfox可以看到,虽然到了404页面,但是返回的http code是200,那就意味着搜索引擎还是会收录这些页面,收录一堆404页面,这对一个网站的排名和收录都没有什么好处。
还有一点就是 搜索引擎会试图获取robots.txt文件,如果404页面没有返回正确的http code的话,那么引擎会得到一个不正确的robots.txt文件,这对于网站的收录也是有害的。
因此不光指定一个404页面,还有注意设置 Response.Status = "404 Not Found"。
相关文章
- loadrunner报HTTP Status-Code=404 2010-07-15
- IIS状态代码的含义 2009-02-17
- 有创意性和趣味性的404错误页面 2011-08-26
- http协议规范 2008-12-25
- flex中HTTPService乱码解决 2009-01-19
- http协议规范(PDF) 2008-12-11
- Java中HttpClient超时设置 2011-11-14
- xmlhttp参考手册 2008-12-11
网友评论
#1: 2011-8-10 21:09:00 by uedcss
学习了,这个还真没注意到
#2: 2011-9-12 20:46:00 by diablo 3
i really like your web site.. quite wonderful colours & theme. did you create this internet site yourself? plz reply back again as i抦 looking to create my own website and would like to know wheere u acquired this from. many thanks
#3: 2011-9-13 8:10:00 by administrator
@diablo 3
thanks, it was created by myself, please let me know should you have any questions.
#4: 2012-3-31 8:54:00 by Ilyes
I'm not esaily impressed but you've done it with that posting.