Customizing the 404 error page is a good way to enhance the user experience, but it often fails to notice the impact on the search engine, such as a bad server-side configuration that causes the return of a "200" status code or a custom 404 error page to use meta-refresh to return a "302" status code. A custom 404 error page that is correctly set should not only be displayed correctly, but should also return the "404" error code instead of "200" or "302". Although the HTTP status code is "404" or "200" for the user, it is very important for the search engine.
Search engine spider when request a URL to get "404" state response, that means that the URL is no longer indexed and the page is deleted from the index database by feedback to the datacenter, and of course the deletion process may take a long time; and when the search engine gets "200" Status code, the URL is considered valid and will be indexed and included in the index database, so that the two different URLs have exactly the same content: Customize the contents of the 404 error page, which causes the replication Web page problem. Light is the search engine down the right, heavy will k off the site.
Visible can not be ignored, inadvertently there is the danger of scattered lives. Then pay attention to the topic is: How to make a user experience conducive to SEO, can retain the user's 404 pages, and is how to set on the server.
First: How to make? Let's look at a few cases before you say:
The above three cases compared with the default 404 page, which is more affinity, which can retain users, the answer is self-evident. From the classic case we can sum up the production of 404 pages of several points:
1, to tell the user where the situation-no information found, error.
2, to tell the user the reason for the error.
3, use vivid language or picture to alleviate the user's mood.
4, tell the user how to solve the problem next.
5, retention of users, enhance affinity.
Second: How to set the problem on the server, in fact, this problem in many places on the internet can be found.
1. For existing Web page content due to the path changes caused by the access, can be defined in IIS 404 error point to a dynamic page, in the page using 301 permanent redirect to jump to the new address, when the server returned 301 status code.
2, set 404 point to a well-designed HTML file, this time the page returns the 404 status code. Now the IDC provider basically provides 404 set of functions, directly upload file settings. To set the method in IIS: Open IIS Manager--> Click the properties of the Web site you want to set custom 404--> click Custom error option--> select 404 Page--> Select and open Edit Properties--> set to URL--> URL to fill in. Err404.html "--> Click OK to exit and then upload the good err404.html page to the site root directory. In message type here, be sure to select file or default, rather than URL, which will result in the return of a "200" status code.
3, 404 point to a dynamic page, such as error.asp, if not set inside the page, just return the hint of the HTML code, will cause the page to return 200 status code, this is not true, we can display the content of the prompt, add the statement: response.status= "404 Not Found" ensures that the page returns a 404 status code.
4, the Apache set 404 error page. The way to set the 404 error page for Apache server is simple, just add the following in the. htaccess file, ErrorDocument 404/notfound.php.
Last few notes:
1, remember not to automatically turn the 404 error to the homepage of the website, otherwise it may cause the homepage to disappear in the search engine.
2, in the robots.txt file to screen out 404 pages.