bluexq - 2013/8/20 22:46:52
己经设置好的404错误页,可以正常跳转到错误页,非 aspx 页可以正常返回404错误代码。 但 aspx 返回的错误代码为302 , 按网上的方法,修改web.config 和 重新制作404页面, 都没有用, 可以跳转到错误页,但返回的代码302或200 ,有什么办法可以返回404代码, 对于搜索引擎来说,这太重要了。
xiyou - 2013/8/21 9:49:49
bluexq - 2013/8/21 22:08:37
不知道如何使用呀。 谁能详细说下。先谢了
[url=]
[/url]protected void Application_Error(
object sender, EventArgs e)
{
Response.Clear();
Response.StatusCode =
404;
Response.Write(
"<html xmlns=\"http://www.w3.org/1999/xhtml/" ><head><meta http-equiv=\
"Content-Type\" content=\"text/html; charset=utf-8\" /><title>页面没有找到</title><meta http-equiv=\"refresh\" CONTENT=\"0; url=/\"></head><body><div>" +
"<div style=\"display:none;\">页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到页面没有找到</div></div></body></html>");
Response.End();
}
[url=]
[/url]
bluexq - 2013/8/24 16:47:54
不知道如何使用呀。 谁能详细说下。先谢了