Reading time: 12 min.
HTTP error codes
Every Internet user at least once stumbled upon errors that are displayed when trying to access a website. Technically, it works like this: the server accepts requests from the user via a browser (or a client), processes information and gives the answer in the form of a numeric code that indicates the response status.
HTTP status codes are standardized three-digit codes that a web server returns in response to HTTP requests from network clients. The first digit indicates the status class. Currently, there are five classes of status response codes (depending on which you need to take certain actions):
- Informational (100–199).
- Successful (200–299).
- Redirection (300–399).
- Client error (400–499).
- Server error (500–599).
Successful and Informational server responses remain invisible for us, while codes referring to a request processing error are displayed on the screen. In this article, we will analyze the main standard types of errors and the possible causes of their occurrence.
4** Client error response (400-499).
HTTP status codes 400-499 indicate an error on the client side of the browser. For example, a request for a non-existent page or lack of valid authentication information. Also, it may be incorrect settings of the web server, site scripts, etc.
Error 400. Bad Request.
Indicates that the request cannot be understood by the server, as it was not made correctly. An invalid URL may have been specified, or a technical failure occurred while transferring data for one of the following reasons:
- unstable Internet connection;
- blocking data transfer by antivirus or firewall;
- browser attempting to download a file that is too large;
- corrupt or expired cookies.
Error 401. Unauthorized.
This code means that authentication is required to access the resource. The login and password were not included in the server's request.
Error 403. Forbidden.
The server cannot fulfill the request due to access restrictions on the resource. In other words, restrictions were imposed by the server administrator or developers. Reasons may be an attempt to access web server system resources such as .htaccess or .htpasswd files, or from a blocked IP address.
Error 404. Not Found.
It is the most common error code. The server cannot find the file or page. The reason may be:
- wrong page address;
- the page has been moved or deleted;
- technical failure due to which the page is temporarily unavailable.
The 404 error code is also used to hide the real reason for refusing to process a request. For security reasons, a 403 error can be disguised as a 404 error.
Error 405. Method Not Allowed.
For each type of operation (download, data transfer), the HTTP protocol requires its own method: GET, POST, and others. This error means that the method defined in the Request-Line cannot be applied to the current resource. It can be displayed, for example, when trying to process files using the POST method instead of the Apache server, or when the interaction between the POST method and the FastCGI module is incorrectly configured.
Error 406. Not Acceptable.
It is a quite rare error that means "the server issues information in a form that the browser or crawler cannot recognize due to data compression or an unsupported format".
Error 407. Proxy Authentication Required.
The error is similar to code 401. The only difference is the authentication is required for the proxy server. As usually, the answer contains recommendations for its fixing.
Error 408. Request timed out.
It means that server timed out for transmission from client. It occurs when large sized files are being transferred, or there is a temporary loss of Internet connectivity, or the server is temporarily overloaded. You can solve this error simply by reloading the page, as well as checking the Internet connection or visit the resource later.
Error 409. Conflict.
Indicates a conflict between the request and the server configuration. Possible reasons:
- conflict with proxies through which the server is accessed;
- access conflict between files on the server itself;
- virus software on the user's device;
- failures in the browser.
Error 410. Gone.
It is similar to a 404 error: The requested page or document is not available. However, a 410 error is displayed when the requested resource has been irreversibly deleted.
Error 411. Length required.
When files are transferred by certain methods and the amount of transferred data is limited, the server refuses to accept a request without a Content-Length header.
Error 412. Precondition failed.
This error means that a precondition processing failure or error was encountered while checking one or more request header fields. To fix the error, it is usually enough to clear the cache and cookies.
Error 413. Request Entity Too Large.
It is displayed when the request is larger than the web server can handle, such as when a file is too large to download. To eliminate it is recommended:
- to compress an image or video before uploading to decrease file size;
- do not upload multiple files at the same time;
- to allow the large file size by changing the settings of the web server that are referred to downloading.
Error 414. Request-URI Too Long.
The server is rejecting the request because the specified URI is too long. This error can occur when the CMS code is configured incorrectly. In the administration panel, each time you go from page to page, data with parameters is added to the URL until the link exceeds the limit. Also, the frequency of displaying error 414 may indicate hacking attempts.
Error 415. Unsupported Media Type.
The server refuses to process a request with the specified data type because the request body has an unsupported format.
Error 416. Range Not Satisfiable.
The server cannot process the request because the Range field in the request header is specified by a range outside the resource.
Error 417. Expectation Failed.
The server for some reason cannot satisfy the value of the requested Expect field header and refuses to process the request.
Error 422. Unprocessable Entity.
This error indicates that the server cannot perform the request because one or more elements may have a logical error.
Error 423. Locked.
The server is refusing to process the request as one of the required resources is blocked to apply this specified method.
Error 424. Failed Dependency.
This error occurs when the server's implementation of the current request depends on another operation that cannot be performed.
Error 426. Upgrade Required.
The server requested to update the connection protocol, but SSL is not supported by the client.
Error 429. Too Many Requests.
Indicates that the user has sent too many requests in a given amount of time. As usually, the response indicates how long to wait before making a new request. It can also point to an attempted DDoS attack.
Error 451. Unavailable For Legal Reasons.
Means that access to the resource was closed for legal reasons. This may be the requirement of public authorities or copyright holders in copyright infringement cases.
Error 499. Client Closed Request.
This is a non-standard code for cases where the client closed the connection without waiting for a response to his request.
5** Server error responses (500–599).
These codes are referred to the errors on the server side. They say that the request is correct and meets all the requirements of the server, but at the moment the server cannot process it. Usually, an explanation of the error is displayed with the code.
Error 500. Internal Server Error.
This error displays any internal server error that is outside the class range. The server is unable to determine the issue or has faced an unexpected condition that prevents it from fulfilling the request.
Error 501. Not Implemented.
In comparison with error 405, when a request method is rejected as invalid, error 501 indicates that the server does not recognize the request method and is unable to process it.
Error 502. Bad Gateway Error.
The error indicates an invalid response message from the upstream server when the request goes through a proxy server and one of the servers in the chain is unable to process the request. This is possible for the following reasons:
- server malfunction;
- of communication between the sections of the request;
- firewall blocking the request;
- incorrect server configuration;
- conflict between servers settings.
Error 503. Service Unavailable.
The server is unable to process requests due to temporary overload or serving:
- the server received too many requests at the same time, and has no enough power to process them;
- technical maintenance is undergoing on the server;
- the limit of users connected to the server has been exceeded.
Also, this error may indicate a DDoS attack or server overload due to insufficient server capacity.
Error 504 Gateway Timeout.
Means that the server as a proxy server did not await for a response from the upstream server, to which the request was sent. The reasons can be either a too short timeout in the settings, or an unstable Internet connection between servers, or server overload with requests.
Error 505. Version Not Supported.
This response can be received if the server does not support the HTTP protocol version passed in the request header. The answer usually contains an explanation of the reason.
Error 507. Not Extended.
The server cannot successfully process the request due to insufficient storage. The problem may be temporary.
Error 510. Not Extended.
The server cannot process the request because the requested extension is missing. You can also require the information about the extensions available to the server.
This is such an impressive list. But those are just standard errors! Experimental or draft are not included to the list. Experience has proven that errors 403, 404, 504 are the most common. They are easy to remember. In other cases, you can always turn to the LLHOST INC. blog, which replenishes your “knowledge bank” weekly.
But that's not all the benefits! Until November 11, 2022, a promo code #httpcodes is valid for all virtual and VPN servers of LLHOST INC. This means that any virtual server (OVS) or VPN server (PVS) plan can be purchased at a -12% discount for 3 months with a monthly billing cycle. And let the errors you meet as little as possible!