404页面其实对于搜索引擎是不友好的,尽量避免发生这样情形,但是在更换域名或者网站地址时,又不得不使用这种方法补救。既然404错误不可避免,那么我们可以使用这样的方法:加上 response.setStatus(200);
这样对于搜索引擎来说就比较友好,不会因为404错误而影响你的SEO效果,非常管用。
<%
response.setStatus(200);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Refresh" content="1;url=http://www.sqlead.com">
<title>Mio-Tour Web Site</title>
</head>
<body>
<div class="errorbg">
<div id="error404_top"></div>
<div class="error404text">
<h1>Error <em>!</em></h1>
<p>the page you requested was not found.</p>
<p>Return to our homepage.</p>
</div>
<img src="../images/error404_bottom.gif" width="517" height="5" /></div>
</body>
</html>