Custom 404 page return Improper status code

Source: Internet
Author: User

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

An HTTP 404 error means that the page to which the link points does not exist. In the website construction wants to completely avoid this kind of situation is impossible, for example, we often need to adjust to the website, the revision, will have the webpage to be deleted, renamed or moves the position, this time, although the corresponding content's webpage also exists in the website, but uses the original address to be unable to access Of course, the first thing to consider for this kind of situation is to do 301 redirects to the original page address to minimize the impact on the SEO effect. -Second, when someone establishes a link to a Web site, it may become an invalid link because of a spelling error: The content page cannot be found within the site.

In short, this type of invalid link is handled automatically by the Web server: When the Web server receives a similar amount of data request, it returns a 404 status code telling the other that the resource it is requesting does not exist. However, the Web server defaults to the 404 error page, both Apache and IIS are very simple, inflexible and unfriendly to users, unable to give users more clues to find the appropriate information, users see such pages often the most direct response and is to close the browser window to leave, which to a large extent to the loss of the site. After all, for the site, users are always the most important resources, in this way loss of users means a certain degree of failure.

This is why many Web sites use custom 404 error pages. Through a good custom 404 page, you can include the corresponding introduction to the site, the user may be interested in content links or content navigation links, content search functions, can effectively help visitors find the content or similar content, improve the user to browse more information in the site opportunities.

Custom 404 error page returns "200" or "302" status code

From a strict technical point of view, the site of the 404 error processing Strategy, is not a SEO aspect of the work, but belong to the site availability (usability) aspects of the problem. Of course, if from the broad sense of SEO category, improve the usability of the website also belongs to the basic operation of SEO. --however, if the custom 404 error page is improperly set, it can greatly affect the SEO effect of the site.

In the impression of many friends, the custom 404 error page As long as the correct display, as long as you can enter a Web site does not exist in the Web page address, in the browser can see the custom error message, the settings are no problem. I am ashamed to say that I am a member of this idea, it technology reviews run nearly a year, recently because of Google's rankings after the decline to check the site found that there is a similar error: a correctly set of 404 pages, not only should be correctly displayed, at the same time, should be able to correctly 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.

Why do you say that? Let's review the process of search engine indexed and indexed pages: Search engine spider to the Web server to send a request to read a page, the Web server received a request to return the HTTP status Code response request, These returned HTTP status codes determine the next step for the search engine: include the page in the indexed database or delete it from the index database.

Of course, there are many kinds of HTTP status code, respectively, corresponding to different situations, the following is related to the content of this article a brief introduction, more detailed information can be referred to the rules of the WWW:

* 404: The requested Web page does not exist (does not exclude the possibility that the link will be valid later);

* 410: The requested Web page does not exist (permanent);

* 200: The server successfully returned to the Web page

* 302: URL temporary redirect (jump)

* 301: Permanent Site redirection

It should be noted that most of the search engines will be "404" and "410" status of the same treatment, such as Google. (See Matt Cutts's note)

When a search engine receives a "404" status response when requesting a URL, you will know that the Web page is no longer in the Web site, so you can delete it in the index database--of course, the removal process may take a long time--and when the search engine gets a "200" status response, the URL is considered valid and return it to the index database.

404 page Returns the consequence of the "200" status code

What happens if the Web site's Custom 404 error page does not return a "404" status code instead of a "200" when the URL is invalid? It is obvious that the search engine will think that the "non-existent" Web page exists within the site, which will lead to many problems, affecting the ultimate SEO effect of the site.

For example, for example, for "http://www.88106.com/a.html", "http://www.88106.com/b.html", two URLs that do not exist in the IT technology reviews site, if the search engine gets a response status code that is " 200 ", then it will be included in the index database, the result is that these two different URLs have exactly the same content: Custom 404 error page Content, this kind of duplicate text (Duplicate content) phenomenon for many search engines are taboo. Especially considering that the site can not only these two invalid links, after all, in the site construction, regardless of the site's internal links or external links, there will inevitably be many such as spelling errors, such as the repetition of more content. In this way, for search engines, especially Google, not only difficult to obtain the ideal Site Trust index, but also greatly reduce the quality of Google's evaluation of the site.

404 error pages 302 problems with Meta refresh

Often see a custom 404 error page for many web sites to take the form of first displaying an error message and then using Meta Refresh to jump the page to the home page, Sitemap, or other similar page. Depending on how the implementation is different, such 404 pages may return "200" status code, may return "302", but either way, from the SEO perspective, is not a suitable choice.

We have talked about the status of "200", so what will the search engine do when the 404 page returns "302"? Theoretically, for the "302" error, the search engine that the Web page exists, but temporarily changed the address, will still index the page, so that the same will appear similar to "200" status code when the duplicate text problem; Second, the mainstream search engine, which is represented by Google, is demanding more and more stringent application scope of 302 redirects, and this kind of improper use of the 302 redirect is a big risk.

Therefore, try not to use this type of Meta Refresh method in the 404 error pages. If the implementation wants to implement similar functions, that is, let the error message appear after a few (10) seconds to jump to the first page or other pages, you can consider using Java Script jump on the 404 error page. Java script is useless and harmless to search engines. :)

Make sure that the custom 404 error page Returns a "404" Status Code

After the custom 404 error page is set up, be sure to check to see if it correctly returns the "404" Status Code.

The check method is also quite simple, using the Server header Check tool provided by this site, or other similar tools such as this, enter a Web site does not exist in the Web page URL, look at the return of the HTTP header, make sure it returns "404 Not Found".

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.