Common HTTP status codes and common http Status Codes
200 OK request successful. It is generally used for GET and POST requests.
301 Moved Permanently is Permanently Moved. The requested resource has been permanently moved to the new URI. The returned information will include the new URI, And the browser will automatically redirect to the new URI. In the future, any new request should be replaced by a new URI.
302 Found temporary movement. It is similar to 301. However, resources are temporarily moved. The client should continue to use the original URI
304 Not Modified is Not Modified. The requested resource is not modified. When the server returns this status code, no resources are returned. The client usually caches the accessed resources and provides a header to indicate that the client only wants to return the resources modified after the specified date.
400 Bad Request client Request syntax error, the server cannot understand
401 Unauthorized requests require user authentication
403 Forbidden server understands the request from the client but rejects the request
404 The Not Found server cannot find resources (web pages) based on client requests ). With this code, the website designer can set the personalized page "the resources you requested cannot be found"
408 The Request Timeout server waits for the client to send a Request for a long time and times out.
500 internal Server Error, unable to complete the request
501 The Not Implemented server does Not support the request function and cannot complete the request.
502 Bad Gateway acts as a Gateway or proxy server and receives an invalid request from the remote server
503 Service Unavailable the server cannot process client requests temporarily due to overload or system maintenance. The delay length can be included in the Retry-After header of the server.
504 Gateway Timeout acts as a Gateway or proxy server and does not get requests from the remote server in time
505 HTTP Version not supported acts as a gateway or proxy server and does not get requests from the remote server in time
PHP sends the 404 status code to the client:
header("HTTP/1.1 404 Not Found");header("Status: 404 Not Found");exit;
PHP uses the header for 301 redirection (permanent ):
header("HTTP/1.1 301 Moved Permanently");Header("Location: http://www.example.com/");exit();
PHP uses the header for 302 redirection (temporary ):
header("Location: http://www.example.com/");exit();