Detailed explanation of various HTTP return status codes

Detailed explanation of various HTTP return status codes

When a request is sent to your server to display a page on your site (for example, when a user visits your page with a browser or when Googlebot crawls it), 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 page.

Some common status codes include:

•200 – The server successfully returned the web page
•404 – The requested page does not exist
•503 – Server Temporarily Unavailable

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

1xx (Provisional Response)
A status code that indicates a provisional response and requires the requester to continue the operation.

Code illustrate
100 (Continued) Requesters should continue to make requests. The server returns this code to indicate that it has received the first part of the request and is waiting for the rest.
101 (Switching Protocol) The requester has asked the server to switch protocols, and the server has acknowledged and is ready to switch.

2xx (Successful)

Status code indicating that the server successfully processed the request.

Code illustrate
200 (Success) The server successfully processed the request. Typically, this means that the server provided the requested web page. If this status is shown for your robots.txt file, it means that Googlebot has successfully retrieved the file.
201 (Created) The request succeeded and the server created the new resource.
202 (Accepted) The server has accepted the request but has not yet processed it.
203 (Unauthorized Message) The server successfully processed the request, but the information returned might have come 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 requester to reset the document view (for example, clear the form contents to enter new content).
206 (partial content) The server successfully processed a partial GET request.

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

Code illustrate
300 (multiple choices) In response to a request, the server can perform a variety of operations. The server can select an action based on the requester (user agent) or provide a list of actions for the requester to choose from.
301 (Moved Permanently) The requested page has been permanently moved to a new location. When the server returns this response (to a GET or HEAD request), it automatically forwards the requester to the new location. You should use this code to tell Googlebot that a page or site has permanently moved to a new location.
302 (Moved Temporarily) The server is now responding to requests from a different location for the web page, but the requester should continue to use the original location for future requests. This code is similar to a 301 code in response to a GET or HEAD request in that it automatically forwards the requester to a different location, but you should not use this code to tell Googlebot that a page or site has moved because Googlebot will continue to crawl and index the old location.
303 (see other locations) The server returns this code when the requester should use separate GET requests to different locations to retrieve the response. For all requests except HEAD, the server automatically forwards to another location.
304 (Not Modified) The requested page has not been modified since the last request. When the server returns this response, no web page content is returned. You should configure your server to return this response (called the If-Modified-Since HTTP header) if the web page has not changed since the requester last requested it. This saves bandwidth and overhead because the server can tell Googlebot that the page has not changed since the last crawl.

.

305 (Use Proxy) The requester can only access the requested web page using a proxy. If the server returns this response, it also indicates that the requester should use a proxy.
307 (Temporary Redirect) The server is now responding to requests from a different location for the web page, but the requester should continue to use the original location for future requests. This code is similar to a 301 code in response to GET and HEAD requests in that it automatically forwards the requester to a different location, but you should not use this code to tell Googlebot that a page or site has moved because Googlebot will continue to crawl and index the old location.

4xx (Bad Request)
These status codes indicate that something might have gone wrong with the request, preventing the server from processing it.

Code illustrate
400 (Bad Request) The server did not understand the syntax of the request.
401 (Unauthorized) The request requires authentication. For web pages that require login, the server may return this response.
403 (Forbidden) The server rejected the request. If you see Googlebot receiving this status code when trying to crawl valid pages on your site (you can see this on the Web Crawl page under Diagnostics in Google Webmaster Tools), it's possible that your server or host is denying Googlebot access.
404 (Not Found) The server could not find the requested webpage. For example, a server typically returns this code if you request a page that doesn't exist on the server. If you don't have a robots.txt file on your site and you see this status on the robots.txt page in the Diagnostics tab of Google Webmaster Tools, then this is the correct status. However, if you have a robots.txt file and you see this status, your robots.txt file may be named incorrectly or located in the wrong place (the file should be located at the top-level domain and named robots.txt).

If you see this status for a URL that Googlebot tried to crawl (on the HTTP Errors page of the Diagnostics tab), it means that Googlebot is following a broken link to another page (either an old link or a link that was typed incorrectly).

405 (Forbidden Method) Disables the method specified in the request.
406 (Not Acceptable) The requested web page cannot be responded to with the requested content characteristics.
407 (Proxy Authorization Required) This status code is similar to 401 (Unauthorized), but specifies that the requester should authorize the use of a proxy. If the server returns this response, it also indicates the proxy that the requester should use.
408 (Request Timeout) The server timed out while waiting for the request.
409 (Conflict) The server encountered a conflict while completing the request. The server MUST include information about the conflict in its response. A server may return this code in response to a PUT request that conflicts with a previous request, along with a list of the differences between the two requests.
410 (Deleted) The server returns this response if the requested resource has been permanently deleted. This code is similar to the 404 (Not Found) code, but is sometimes used instead of a 404 code when a resource previously existed and no longer exists. If the resource has been permanently deleted, you should use 301 to specify the new location of the resource.
411 (Valid Length Required) The server did not accept a request without a valid Content-Length header field.
412 (Precondition Not Met) The server did not meet one of the preconditions set by the requester in the request.
413 (Request Entity Too Large) The server cannot process the request because the request entity is too large for the server to process.
414 (Requested URI Too Long) The requested URI (usually a URL) is too long for the server to process.
415 (Unsupported Media Type) The requested format is not supported by the requested page.
416 (Requested range does not meet requirements) The server returns this status code if the page cannot provide the requested range.
417 (Expectations not met) The server did not meet the requirements of an 'Expect' request-header field.

5xx (Server Error)
These status codes indicate that an internal error occurred while the server was trying to process the request. These errors may be errors with the server itself, rather than errors with the request.

Code illustrate
500 (Internal Server Error) The server encountered an error and could not complete the request.
501 (Not yet implemented) The server does not have the functionality to fulfill the request. For example, the server might return this code if it does not recognize the request method.
502 (Bad Gateway) The server was acting as a gateway or proxy and received an invalid response from an upstream server.
503 (Service Unavailable) The server is currently unavailable (either because it is overloaded or down for maintenance). Usually, this is only a temporary condition.
504 (Gateway Timeout) The server was acting as a gateway or proxy and did not receive the request from the upstream server in a timely manner.
505 (HTTP Version Not Supported) The server does not support the HTTP protocol version used in the request.

The above is all the content about the detailed explanation of various HTTP return status codes brought to you by the editor. I hope you will support 123WORDPRESS.COM~

Original URL: http://www.cnblogs.com/zhangym118/archive/2016/06/27/5619590.html

<<:  CSS to achieve pop-up window up and down center left and right and transparent background lock window effect

>>:  Analysis of the underlying principle of MySQL multi-version concurrency control MVCC

Recommend

Nginx uses ctx to realize data sharing and context modification functions

Environment: init_worker_by_lua, set_by_lua, rewr...

Automatic failover of slave nodes in replication architecture in MySQL 8.0.23

I have been in contact with MGR for some time. Wi...

mysql is not an internal command error solution

The error "mysql is not an internal command&...

Detailed explanation of simple snow effect example using JS

Table of contents Preface Main implementation cod...

Ubuntu MySQL version upgraded to 5.7

A few days ago, the library said that the server ...

MySQL integrity constraints definition and example tutorial

Table of contents Integrity constraints Definitio...

Details after setting the iframe's src to about:blank

After setting the iframe's src to 'about:b...

Using react-virtualized to implement a long list of images with dynamic height

Table of contents Problems encountered during dev...

How to implement navigation function in WeChat Mini Program

1. Rendering2. Operation steps 1. Apply for Tence...

Don't forget to close the HTML tag

Building web pages that comply with Web standards ...

10 tips for designing useful, easy-to-use web applications

Here are 10 tips on how to design better-usable w...