在前一章的seo优化教程中,我们讲到了百度快照是什么?这次我们来了解一下,404 not found是什么意思?如何解决404错误页面?
本文目录:
1.404 not found是什么意思
2.404页面走丢的原因
3.404错误页面怎么制作
4.404页面的作用
5.404错误页面常见问题
5.1、404错误怎么解决
5.2、404页面是否要屏蔽
一、404 not found是什么意思
404,是http对网页错误情况返回的一种状态码,返回码全称为“404 not found”,对于返回的页面,我们也叫404错误页面。
可以理解为,404错误页面,404页面,404 not found,都表示访问的链接出错,表示同一个意思。
二、 404页面走丢的原因
1.用户输入错误地址
这是个常见错误,用户输错地址,无法访问正常页面,导致服务器出现404 not found提示。
2.网站改版
网站改版最容易出现404错误页面,改版包括程序更换、链接规则改变、页面内容改变等,造成数据库信息无法对接,产生的链接错误,我们也称之为“死链”。
3.页面被删除或更改
页面被网站的seo删除,或者说更改移动到其它栏目,都会造成404 not found页面。
4.解析错误、dns设置阻止、域名被墙
4.1、解析错误会让服务器找不到正确的调用地址,浏览页面时会有404 ;
4.2、dns设置阻止会让解析中断找不到数据,也会有404 not found提示,通常在国内访问国外网站会出现这个情况;
4.3、网站有违规、违法信息,被国家防火墙(GFW)检测到从而拦截,就会导致网站域名被墙,严重的会导致服务器ip被墙,网站直接就打不开,这个时候会出现404 not found提示;
三、404错误页面怎么制作
分享一个自己常用的404错误页面源码,直接将下面代码复制,将链接改为自己的,然后命名为“404.html”,上传到根目录就可以了。
404错误页面源码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> #代码来源大仙seo,www.daxianseo.cn <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>瑞昌山药网-404</title> <style type="text/css"> body{margin:0;padding:0;font:14px/1.6 Arial,Sans-serif;background:#fff url(img/body.png) repeat-x;} a:link,a:visited{color:#007ab7;text-decoration:none;} h1{ position:relative; z-index:2; width:540px; height:0; margin:110px auto 15px; padding:230px 0 0; overflow:hidden; xxxxborder:1px solid; background-repeat: no-repeat; } h2{ position:absolute; top:55px; left:233px; margin:0; font-size:0; text-indent:-999px; -moz-user-select:none; -webkit-user-select:none; user-select:none; cursor:default; width: 404px; height: 90px; } h2 em{display:block;font:italic bold 200px/120px "Times New Roman",Times,Serif;text-indent:0;letter-spacing:-5px;color:rgba(216,226,244,0.3);} .link a{margin-right:1em;} .link,.texts{width:540px;margin:0 auto 15px;color:#505050;} .texts{line-height:2;} .texts dd{margin:0;padding:0 0 0 15px;} .texts ul{margin:0;padding:0;} .portal{color:#505050;text-align:center;white-space:nowrap;word-spacing:0.45em;} .portal a:link,.portal a:visited{color:#505050;word-spacing:0;} .portal a:hover,.portal a:active{color:#007ab7;} .portal span{display:inline-block;height:38px;line-height:35px;background:url(img/portal.png) repeat-x;} .portal span span{padding:0 0 0 20px;background:url(img/portal.png) no-repeat 0 -40px;} .portal span span span{padding:0 20px 0 0;background-position:100% -80px;} .STYLE1 { font-family: Arial, Helvetica, sans-serif; font-size: 65px; } </style> <!--[if lte IE 8]> <style type="text/css"> h2 em{color:#e4ebf8;} </style> <![endif]--> </head> <body> <h1></h1> <h2><em><span class="STYLE1">404 Error </span></em>:所查找的页面不存在,可能已被删除或您输错了网址!</h2> <p class="link"> <a href="/">◂首页</a> | <a href="/about">◂瑞昌山药</a> | <a href="/gongxiao">◂山药功效</a> | <a href="/jiage">◂山药价格</a> | <a href="/syzf">◂山药禁忌</a> </p> <dl class="texts"> <dt>正在联系瑞昌有为传媒工作室查找您所需要的页面.请返回等待信息..</dt> <dd> <ul> <li>不要返回吗?</li> <li>确定不要返回吗?</li> <li>真的真的确定不要返回吗?</li> <li>好吧.还是随便你要不要真的确定返回吧</li> <li>瑞昌有为传媒工作室版权所有</li> </ul> </dd> </dl> </span></span></span></p> </body> </html>
四、404页面的作用
制作好404错误页面,作用巨大,主要两点:
1.保证用户在访问错误页面的时候,可以在404错误页面点击按钮返回网站,而不是直接关闭页面;
2.让搜索引擎蜘蛛认识到,即便是404错误页面,也有链接可返回网站,不会因为无链接返回而造成死循环抓取。
五、404错误页面常见问题
5.1、404错误怎么解决
详情请看第三点,制作好404页面;如果死链居多,可以提交死链给百度,具体请看:百度站长工具教程:死链提交教程。
5.2、404页面是否要屏蔽
针对部分seo的纠结,即404页面是否需要在robots文件里屏蔽,这里大仙建议大家可以选择屏蔽404错误页面。
赞赏微信赞赏
支付宝赞赏