404页面的目的是告诉访问者他们所请求的页面不存在或有链接错误,并引导用户访问网站上的其他页面,而不是关闭窗口然后离开。
很多开源系统,包括CMS系统、Blog系统等,不提供404页面,或者提供不符合SEO要求的404页面,这损害了网站的权威性。
404页面要达到什么样的SEO要求呢?
搜索引擎使用HTTP状态码来识别网页的状态。当搜索引擎得到错误的链接时,网站应该返回404状态码,并告诉搜索引擎放弃该链接的索引。如果返回的状态代码为200或302,则搜索引擎会对该链接进行索引,这将导致指向相同网页内容的大量不同链接。结果,搜索引擎对网站的信任度直线下降。_很多网站都有这样的问题:404页面返回200或302状态码,而不是404状态码。
创建404页面的正确方法是:(仅使用Apache服务器)
in.Addcode:ErrorDocument404/Error.htmltothehtAccessfile
创建一个简单的html404页面命名Error.html
将Error.html放置在网站的根目录中
注意:
不要将404错误直接转移到网站首页,这会导致网站首页无法收录;
/Error.html不使用主域名,否则返回状态码为302或200状态码。
404页面该怎么做?
Copyright & Disclaimer: If you find copyright issues, please provide relevant information and email us at [email protected], we will communicate promptly and handle removal.
Except for specially marked original content on abcdlink (https://www.abcdlink.com) all other content is reposted by users, and opinions/copyright are unrelated to this site.
