Various HTTP return status codes in detail

Source: Internet
Author: User
Tags unsupported

One HTTP status Code

If a request is sent to your server asking to display a webpage on your site (for example, when a user accesses your page through a browser or Googlebot crawls a webpage), the server returns an HTTP status code in response to the request.

This status code provides information about the status of the request, telling Googlebot about your site and the requested Web page.

Some common status codes include the following:

    • -Server successfully returned to Web page
    • 404 – The requested page does not exist
    • 503 – The server is temporarily unavailable

A complete list of HTTP status codes is provided below. Click on the link to learn more. You can also access the Web page about HTTP status codes for more information.

1XX: Request received, continue processing
2XX: Successful operation received, analysis, acceptance
3XX: Completion of this request must be further processed
4XX: request contains an error syntax or cannot be completed
5XX: Server performs a fully valid request failure



1xx (temporary response)
A status code that represents a temporary response and requires the requestor to continue the operation.

Code description

100 (Continue) The requestor shall continue to make the request. The server returns this code to indicate that the first part of the request was received and is waiting for the remainder.
101 (Switching protocol) The requestor has asked the server to switch protocols and the server has confirmed and is ready to switch.

2xx (Success)

Indicates that the server successfully processed the request's status code.

Code description

200 (success) The server has successfully processed the request. Typically, this indicates that the server provided the requested Web page. If this status is displayed for your robots.txt file, it means that Googlebot has successfully retrieved the file.
201 (created) The request was successful and the server created a new resource.
202 (accepted) The server has accepted the request but has not yet processed it.
203 (non-authorised information) The server has successfully processed the request, but the information returned may be from another source.
204 (no content) The server successfully processed the request, but did not return any content.
205 (Reset content) The server successfully processed the request, but did not return any content. Unlike the 204 response, this response requires the requestor to reset the document view (for example, to clear the form contents to enter new content).
206 (partial content) The server successfully processed a partial GET request.

3xx (redirected)
Further action is required to complete the request. Typically, these status codes are used for redirection. Google recommends that you use redirects no more than 5 times per request. You can use the Webmaster tools to see if Googlebot is having trouble crawling the redirected pages. The network crawl page under diagnosis lists URLs that Googlebot cannot crawl due to redirection errors.

Code description

300 (multiple options) For requests, the server can perform a variety of operations. The server can select an action based on the requestor (user agent) or provide a list of actions for the requestor to select.
301 (Permanent movement) The requested page has been permanently moved to a new location. When the server returns this response (a response to a GET or HEAD request), the requestor is automatically forwarded to the new location. You should use this code to tell Googlebot that a Web page or Web site has been permanently moved to a new location.
302 (temporarily moved) The server currently responds to the request from a different location, but the requestor should continue to use the original location for future requests. This code, similar to the 301 code in response to a GET or HEAD request, automatically transfers the requestor to a different location, but you should not use this code to tell Googlebot that a Web page or site has moved because Googlebot continues to crawl the original location and index it.
303 (See other locations) The server returns this code when the requestor should use a separate GET request for a different location to retrieve the response. For all requests except HEAD, the server automatically goes to a different location.
304 (not modified) The requested page has not been modified since the last request. When the server returns this response, the Web page content is not returned. If the page has not changed since the requestor last requested it, you should configure the server to return this response (known as the If-modified-since HTTP header). Because the server can tell Googlebot that the page has not changed since the last crawl, it saves bandwidth and overhead

305 (use proxy) The requestor can only use the proxy to access the requested Web page. If the server returns this response, it also indicates that the requestor should use the proxy.
307 (Temporarily redirected) The server currently responds to the request from a different location, but the requestor should continue to use the original location for future requests. This code, similar to the 301 code that responds to the GET and HEAD requests, automatically transfers the requestor to a different location, but you should not use this code to tell Googlebot that a page or site has moved because Googlebot continues to crawl the original location and index it.

4xx (Request error)
These status codes indicate a possible error in the request and hinder the processing of the server.

Code description

400 (Bad Request) The server does not understand the syntax of the request.
401 (not authorized) Request authentication required. The server may return this response for pages that need to log on.
403 (Forbidden) The server rejected the request. If you see Googlebot receiving this status code when trying to crawl a valid webpage on your site (this information can be seen on the Web crawl page under Google Webmaster Tools Diagnostics ), your server or host may be rejecting Googlebot access.
404 (Not Found) The server could not find the requested Web page. For example, if you request a Web page that does not exist on the server, the server typically returns this code. If you do not have a robots.txt file on your site and you see this status on the robots.txt page of the Google Webmaster Tools Diagnostics tab, this is the correct state. However, if you have a robots.txt file and you see this status, your robots.txt file may be named incorrectly or in the wrong location (the file should be in the top-level domain named robots.txt).

If you see this status for URLs that Googlebot try to crawl (on the HTTP error page of the Diagnostics tab), it means that Googlebot tracking may be an invalid link to another page (a link that is old or incorrectly entered).

405 (Disabled method) Disables the method specified in the request.
406 (not acceptable) The requested content attribute could not be used to respond to the requested Web page.
407 (requires proxy authorization) This status code is similar to 401 (unauthorized), but specifies that the requestor should authorize the use of the proxy. If the server returns this response, it also indicates which proxy the requestor should use.
408 (Request timed out) A timeout occurred while the server was waiting for a request.
409 (conflict) The server encountered a conflict while completing the request. The server must include information about the conflict in the response. The server may return this code in response to a PUT request that conflicts with the previous request, along with a list of the two requested differences.
410 (Deleted) If the requested resource has been permanently deleted, the server returns this response. This code is similar to the 404 (not Found) code, but is sometimes used to replace the 404 code in cases where the resource existed before and now does not exist. If the resource has been permanently deleted, you should use 301 to specify a new location for the resource.
411 (valid length required) The server does not accept requests that do not contain a valid Content-Length header field.
412 (precondition not met) The server did not meet one of the prerequisites set by the requestor in the request.
413 (Request entity too Large) The server cannot process the request because the request entity is too large to exceed the processing power of the server.
414 (The requested URI is too long) The requested URI (usually the URL) is too long and the server cannot process it.
415 (Unsupported media type) The requested format is not supported by the requested page.
416 (Request scope does not meet the requirements) If the page cannot provide the requested scope, the server returns this status code.
417 (not meeting the expected requirements) The server does not meet the requirements for the expected Request header field.

5xx (server error)
These status codes indicate that the server has an internal error while trying to process the request. These errors may be the error of the server itself, not the request.

Code description

500 (server internal error) The server encountered an error and could not complete the request.
501 (not yet implemented) The server does not have the capability to complete the request. For example, this code may be returned when the server does not recognize the request method.
502 (Wrong Gateway) The server acts as a gateway or proxy and receives an invalid response from the upstream server.
503 (service not available) The server is not currently available (due to overloading or downtime maintenance). Typically, this is only a temporary state.
504 (Gateway Timeout) The server acts as a gateway or proxy, but does not receive requests from the upstream server in a timely manner.
505 (HTTP version not supported) The HTTP protocol version used in the request is not supported by the server.

English version:

100:continue
101:switching protocols
102:processing

200:ok
201:created
202:accepted
203:non-authoriative Information
204:no Content
205:reset Content
206:partial Content
207:multi-status

300:multiple Choices
301:moved Permanently
302:found
303:see Other
304:not Modified
305:use Proxy
306: (Unused)
307:temporary Redirect

400:bad Request
401:unauthorized
402:payment granted
403:forbidden
404:file not Found
405:method not allowed
406:not acceptable
407:proxy Authentication Required
408:request time-out
409:conflict
410:gone
411:length Required
412:precondition Failed
413:request Entity Too Large
414:request-uri Too Large
415:unsupported Media Type
416:requested Range Not satisfiable
417:expectation Failed
422:unprocessable Entity
423:locked
424:failed Dependency

500:internal Server Error
501:not implemented
502:bad Gateway
503:service unavailable
504:gateway Timeout
505:http Version not supported
507:insufficient Storage

No. No. 200 Status code

220.181.32.30--[02/sep/2008:00:01:23 +0800] "get/article/0572/72570.shtml http/1.1" 28361 "-" "baiduspider+ (+http ://www.baidu.com/search/spider.htm) "

200 in the server log indicates a successful download of Web 72570.shtml using get delivery. That is: when the user or the crawler to the site server to make a browse request, the server returned the HTTP data stream contains a status code, 200 response number is a status code of one, indicating that this page was successfully downloaded.

No. No. 301 Status Code

220.181.32.30--[02/sep/2008:00:01:31 +0800] "get/my/view.php?aid=14183 http/1.1" 301-"-" "baiduspider+ (+http://www. baidu.com/search/spider.htm) "

301 in the server log indicates a successful jump using the get pass-through Dynamic Web page aid=14183. That is, when a user or crawler sends a browse request to the Web server, the server returns an HTTP data stream containing a status code, 301 redirects that are one of the status codes, indicating that the page is permanently transferred to another address. In practice, we can point to a number of domain names to the same URL, which is the only endorsement of the search engine a Web site to turn the way.

Two,404 status Code

220.181.32.30--[02/sep/2008:00:01:51 +0800] "get/writing http/1.1" 404 4459 "-" "baiduspider+ (+http://www.baidu.com/s earch/spider.htm) "

The presence of a 404 status code proves that a Web page with a URL address cannot be browsed. Many times due to the revision of the site, so many old website URL address invalidation. This is what you need to create a 404 status page to ensure that your site is unobstructed and able to achieve a loop effect. Remember that the 404 status page needs to be designed individually and not directly on the server side to jump back to the page. Otherwise, the search engine will crawl a lot of site home errors as 404 page processing.

Deep understanding of the HTTP404 status code

HTTP 404 error means that the link to the page does not exist, that is, the URL of the original page is invalid, this situation often occurs, it is difficult to avoid, such as: Web page URL generation rule changes, Web page file renaming or moving location, import links spelling errors, etc., resulting in the original URL address is inaccessible; When the server receives a similar request, it returns a 404 status code telling the browser that the resource being requested does not exist. However, the Web server default 404 error page, whether Apache or IIS, is very primitive, inflexible and unfriendly to the user, unable to provide users with the necessary information to obtain more clues, this will undoubtedly lead to the loss of users.

As a result, many websites use custom 404 error ways to provide a user experience that avoids user churn. In general, custom 404 pages are commonly used to place Web site quick navigation links, search boxes, and featured services provided by the site, which effectively help users access the site and get the information they need.

The influence of HTTP404 on SEO

Customizing the 404 error page is a good way to provide a user experience, but often does not notice the impact on the search engine in the application process, such as: Incorrect server-side configuration results in the return of "200" status code or a custom 404 error page Using Meta Refresh to return "302" status code. The custom 404 error page that is set correctly should not only be displayed correctly, but should also return a "404" error code instead of "200" or "302". Although the HTTP status code is no different for the user to access, it is very important for the search engine to be "404" or "200".

1. Custom 404 error page Return "200" status code

When a search engine spider requests a URL address to get a "404" status response, that is, that the URL address has been invalidated, the page is no longer indexed, and the data center to feedback the URL represented by the Web page is deleted from the index database, of course, the deletion process may take a long time, and when the search engine gets " 200 "status response, the URL address is considered valid, it will be indexed, and will be ingested into the index database, the result is that these two different URLs have exactly the same content: Custom 404 error page content, which will lead to replication Web page problems. For search engines, especially Google, it is not only difficult to obtain the trust index TrustRank, but also greatly reduce Google's assessment of the quality of the site.

When using Google Sitemap, when submitting an XML-formatted sitemap file, the Google Admin tool verifies the identity of the site to ensure that it is a legitimate administrator of the site. There are two types of authentication: uploading an HTML page of the specified name to the root of the Web site or adding a meta tag that identifies identities in the Web meta area. Usually the way to upload HTML pages, but the Google Administrator tool is prompted to find this page in the root directory, this is a very scary question.

2. Custom 404 error page Use Meta Refresh to return "302" status code

Often see a custom 404 error page for many sites taking a form like this: first displaying an error message, and then using Meta Refresh to jump the page to the homepage, page map, or other similar page. Depending on the implementation, this type of 404 page may return "200" status code, may also return "302", but either way, from the SEO technical point of view, is not a suitable choice.

We have already talked about the status of "200", so what will the search engine do when the 404 page returns to "302"? Theoretically, for the "302" error, the search engine believes that the page exists, but temporarily changed the address, will still index the page, so that the same will appear similar to Duplicate text problem with "200" status code; Secondly, the mainstream search engine, which is represented by Google, is more and more strict in the application scope of 302 redirects, and there is a great risk for such improper use of 302 redirects.

Ensure custom 404 error page can return "404" Status Code

After the custom 404 error page is set up, be sure to check that it returns the "404" Status code correctly. You can use the Server Header Check tool, enter a URL for a nonexistent Web page, and look at the return of the HTTP header, and make sure it returns "404 Not Found".

Various HTTP return status codes in detail

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.