您好,欢迎访问本站博客!登录后台查看权限
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧
  • 网站所有资源均来自网络,如有侵权请联系站长删除!
  • 了解seo技术,运营知识,营销策略,,MU MU ZHONG CHENG——沐目忠诚
  • 忠告:无论她(他)怎么对你,你都不能伤害她、她有她得难!

404页面自动跳转模板

SEO.推广 沐目忠诚 2010-11-30 641 次浏览 0个评论
网站分享代码

         404页面是什么

         404页面就是当用户输入了错误的链接时,返回的页面。

 

  404页面的目的是:告诉浏览者其所请求的页面不存在或链接错误,同时引导用户使用网站其他页面而不是关闭窗口离开。

 

  404对seo的影响

 

  自定义404错误页面是增强用户体验的很好的做法,但在应用过程中往往并未注意到对搜索引擎的影响,譬如:错误的服务器端配置导致返回“200”状态码或自定义404错误页面使用Meta Refresh导致返回“302”状态码。正确设置的自定义404错误页面,不仅应当能够正确地显示,同时,应该返回“404”错误代码,而不是 “200”或“302”。虽然对访问的用户而言,HTTP状态码究竟是“404”还是“200”来说并没有什么区别,但对搜索引擎这则是相当重要的。

 

  搜索引擎蜘蛛在请求某个URL时得到“404”状态回应时,即知道该URL已经失效,便不再索引该网页,并向数据中心反馈将该URL表示的网页从索引数据库中删除,当然,删除过程有可能需要很长时间;而当搜索引擎得到“200”状态码时,则会认为该url是有效的,便会去索引,并会将其收录到索引数据库,这样的结果便是这两个不同的url具有完全相同的内容:自定义404错误页面的内容,这会导致出现复制网页问题。轻则被搜索引擎降权,重则会K掉网站。

 

  如何实现一个良好的404页面

 

  改变服务器默认错误页面就可以达到效果。下面是一些可以使得访客轻松实现正常访问的建议。 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="refresh" content="7;URL=/" />
<title>HTTP 404 - Page not found - 未找到页面</title>
<style type="text/css">
<!--
body {
 font-family:Arial Black, 宋体, Times New Roman;
 font-size:12px;
 width: 100%;
 margin: 0;
 padding: 0;
 background: #E5E5E5;
}
.Page {
    width: 500px;
 margin: 0 auto;
}
.conter {
    width: 100%;
 margin-top: 100px;
 border: 1px solid #C2C2C2;
    background: #FFFFFF url('../404html/seeyou.gif') no-repeat left top;
}
.pagetop {
    width: 100%;
 text-align: right;
 height: 60px;
}
.h1 {
    color:#222;
 font-size:22px;
 padding:10px 30px 0 0;
 }
.h6 {
    color:#789;
 font-size:14px;
 padding:10px 30px 0 0;
}
.h2 {
    color:#999;
 font-size:12px;
 font-weight:bold;
 margin:0 30px;
 padding-bottom: 10px;
}
.pagebootom {
    width:100%;
}
.h3 {
    color:#999;
 font-size:14px;
 font-weight:bold;
 text-align:left;
 margin:10px 30px 10px 105px;
}
.copyright {
    color:#cacaca;
 font-size:12px;
 text-align:right;
 margin:10px 30px;
 padding-bottom: 10px;
 font-family:Times New Roman;
}
-->
</style>
</head>
<body>
<div class="Page">
   <div class="conter">
      <div class="pagetop">
      <div class="h1">HTTP/1.1 404 - Page not found</div>
      <div class="h2">未找到给您看的页面</div>
      </div>
      <div class="pagebootom">
      <div class="h3">1. 可能您输入的地址有误 !</div>
   <div class="h3">2. 也可能您访问的页面我们取消了 !</div>
   <div class="h3">3. 没关系,马上带您返回我们的首页 !</div>
      </div>

<div class="conter"><div class="h6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对不起,<a title=红外测温仪、大电流发生器、试验变压器 href="http://www.shshujia.net.cn">沐目忠诚</a>提醒您没有找到您需要的页面!
倒计时(<b><span id="timer" style="COLOR:#ec5105">60</span></b>)秒返<br>&nbsp;&nbsp;&nbsp;回到首页,或者点击<a href="http://www.zxggzs.cn"><b>此处</b></a>立即回到首页。</div>
<SCRIPT>
(function(){
var i=60;
intervalID=setInterval(function(){
document.getElementById('timer').innerHTML=i;
if(i<=2){
   window.clearInterval(intervalID);
   document.getElementById('timer').innerHTML="0";
   window.location.href= "http://www.zxggzs.cn";
}else{
   i=i-7;
}
},50);
})();
</SCRIPT>  
      </div>
     
   <div class="copyright"><!-- 此404页面版权归wdsXp.com所有 -->404 Page by China_Y</div>
   </div>
</div>
</body>
</html>

以上404倒计时跳转的源代码!下面再附上模板赠送。

404.rar

已有 641 位网友参与,快来吐槽:

发表评论