Introduction
When you access a web page, each HTTP request received by the server is responded to with an HTTP status code. HTTP status codes are three-digit codes grouped into five different classes. The class of a status code can be identified by its first digit:
1xx: Informational
2xx: Success
3xx: Redirection
4xx: Client Error
5xx: Server Error
Overview of Client and Server Errors
Client errors or HTTP status codes from 400 to 499 result from HTTP requests sent by a web browser. Although these error types are related to the client, it is often useful to know the error code a user encounters to determine if the potential problem can be resolved by server configuration.
Server errors or codes from 500 to 599 are returned by a web server when an error occurs or the server cannot process the received request.
400 Bad Request
Status code 400 or Bad Request error means that the HTTP request sent to the server has invalid syntax.
Examples when a 400 Bad Request error may occur:
The user’s cookie associated with the site is corrupted. Clearing the browser cache and cookies might resolve this issue.
Bad request due to a faulty browser.
401 Unauthorized
Error 401 occurs when you try to access a password-protected web page, and the provided login credentials are incorrect.
403 Forbidden
Status code 403 means the user made a valid request, but the server refuses to serve the request due to lack of permission to access the requested resource. If you encounter a 403 error, causes may include a missing index.xx file or the web server not having permission to read files in that folder.
404 Not Found
Perhaps the most common error, the 404 error means the link you want to access does not exist.
500 Internal Server Error
Status code 500 or Internal Server Error means the server cannot process the request for an unknown reason. The most frequent cause is misconfiguration of the server (e.g., an .htaccess file with errors) or trying to execute a PHP file without PHP properly installed.
502 Bad Gateway
Error 502 or Bad Gateway means the server is a gateway or proxy server and is not receiving a valid response from backend servers that should fulfill the request.
503 Service Unavailable
Error 503 or Service Unavailable means the server is overloaded or under maintenance. If the site is not under maintenance, this may indicate the server lacks sufficient processor or memory resources to handle all incoming requests.
504 Gateway Timeout
Status code 504 or Gateway Timeout means the server is a gateway or proxy server and does not receive a response from backend servers within the allowed time period.
This usually happens in the following situations:
Network connection between servers is poor
The backend server fulfilling the request is too slow due to poor performance
The gateway or proxy server timeout duration is too short