SEO needs to start small, and any small detail will have a huge impact. It is difficult to completely avoid incorrect links in a website. The 404 page, as an error link return page, plays a crucial role in user experience.
The role of the 404 page: The page returned when the user enters an incorrect link.
The purpose of the 404 page: to friendly let the viewer know that the page they are visiting does not exist or the link parameter is wrong. The important point is that the 404 error page does not let the user know that the page they are visiting does not exist and close the page, but guides the user to visit other pages of the website. , to ensure the existence of ip.
Nowadays, many open source blogs, CMS, etc. do not provide 404 pages, so that the 404 pages lose their role and cannot achieve SEO optimization effects. This not only reduces the user experience, but also greatly reduces the authority of the website.
How to make the 404 page meet SEO requirements and improve user experience?
There are many types of HTTP status codes, common ones are:
200 Request successfully processed
204 Processing successful but content
301 Requesting that the webpage be moved permanently
302 Request that the web page be temporarily moved to a new location (the original URL is saved in the search engine index)
500 server error
503 The server is unavailable (overloaded or under maintenance), etc.
When a search engine accesses a page and gets an incorrect link, it will return a 404 status code to let the search engine know that the URL is wrong and give up indexing the URL. On the other hand, if a 200 or 302 status code is returned, the search engine will index the URL. If a large number of incorrect URLs appear, the search engine will be disgusted and the trust in the website will be greatly reduced.
Create the correct 404 page: (Apache server)
Add code to the .htaccess file: ErrorDocument 404 /404.html (404 errors cannot be directed to the homepage of the website, which will result in the homepage not being included. Do not include the main domain name in front of /Error.html, otherwise the returned status code will be 302 or 200 status code).
At the same time, create an html page named 404.html
Place 404.html in the root directory of the website
Create the correct 404 page: (IIS/.net)
First, modify the settings of the application root directory, open the web.config file for editing, and add the following content to it:
<configuration>
<system.web>
<customErrors mode=On defaultRedirect=error.asp>
<error statusCode=404″ redirect=notfound.asp />
</customErrors>
</system.web>
</configuration>
error.asp is the system's default 404 page, and notfound.asp is a customized 404 page. The corresponding file name can be modified during use.
Add the following to the custom 404 page notfound.asp:
<% Response.Status = 404 Not Found %>
Allow IIS to correctly return the 404 status code. The setting is now complete
Use redirects for 404 pages
When users access a 404 error page with an error link, they usually close the page directly because there is no content they need on the page. At this time, you can reset the 404 page, but you must leave the user with a choice, otherwise the user experience will be reduced.
You can write on the 404 page: The page is not found! Jump to the homepage after 5 seconds. Give visitors 5 seconds to read the information and then redirect.
The method of use is as follows.
<html>
<head>
<meta http-equiv="refresh" content="5; url=http://www.souduoduo.com">
</head>
<body>
The page was not found! Jump to the homepage after 5 seconds.
</body>
</html>
The content is followed by the countdown seconds, and the url is followed by the jump address.
Please indicate when reprinting: http://www.souduoduo.com .
Thanks for the contribution of Qijingnian