404 The purpose of the page is to tell the browser that the requested page does not exist or link the error, while directing the user to use other pages of the site instead of closing the window to leave.
Many open-source systems, including CMS systems, blog systems, etc. do not provide 404 pages or provide 404 pages did not meet the requirements of SEO, which makes the site's authority greatly discounted.
404 page How to achieve the effect to meet the SEO requirements?
The search engine uses the HTTP status code to identify the state of the page. When the search engine gets a bad link, the site should return a 404 status code that tells the search engine to discard the index of the link. If a 200 or 302 status code is returned, the search engine will index the link, resulting in a number of different links pointing to the same page content. As a result, search engines have significantly reduced trust in the site. --Many websites have this problem: 404 the page Returns a 200 or 302 status code instead of a 404 status code.
The correct way to build 404 pages is: (only for Apache servers)
Method One:
First you have to open Apache's Rewrite_module module, support. htaccess. The. htaccess file (or already exists) is then created at the root of the Web site, plus this sentence errordocument 404/404.html can be
Method Two:
- # vi/etc/httpd/conf/httpd.conf
- Cancel ErrorDocument 404/missing.html Pre-comment
- Can be modified to:
- ErrorDocument 404/errpage/404.html
- The path to place the 404 error page is the Errpage directory in the Apache root directory
- Then create a new 404.html in/var/www/html/errpage and fill in the customizations
- # Service httpd Restart
Attention:
- Do not turn 404 errors directly to the homepage of the website, which will lead to the homepage is not included;
- Do not bring the primary domain name in front of/error.html, otherwise the status code returned is 302 or 200 status code.
This allows you to customize some of the more user-friendly tips: For example, the page is being maintained moderately.
Custom 404 error page under Apache