Errors and their causes


Errors in the HTTP protocol are the behavior of a web server when, for some reason, it cannot successfully send the requested document to the client. The server reports the error code to the client in the HTTP header.


Each error issued by the web server has a code corresponding to the class of the error that occurred. Error codes (e.g. 403 or 404) are standardized and described in detail in the Internet standard RFC2616 (Hypertext Transfer Protocol -- HTTP/1.1). You can refer to this document for a detailed description of a specific error as the original source.


Example of a web request made manually using the telnet program:


# telnet www.hostetski.ru 80
Trying 217.16.20.20...
Connected to www.
hostetski.ru.
HEAD / HTTP/1.1
Host: www.
hostetski.ru

HTTP/1.1 200 OK
Date: Mon, 29 Mar 2004 08:24:07 GMT
Server: CoffeeMaker/1.12 (Unix) mod_ssl/2.8 OpenSSL/0.9

The server issued a successful error code 200 (OK). This was an example of a correct request to an existing document on the server, which ended successfully. If the requested document had not been on the server, the server would have behaved differently and would have given a 404 error (the document was not found):


# telnet www.hostetski.ru 80
Trying 217.16.20.20...
Connected to www.
hostetski.ru.
HEAD /abcdef HTTP/1.1
Host: www.
hostetski.ru

HTTP/1.1 404 Not Found
Date: Mon, 29 Mar 2004 08:42:01 GMT
Server: CoffeeMaker/1.12 (Unix) mod_ssl/2.8 OpenSSL/0.9

Error codes can be positive and negative, or successful and unsuccessful. There are four types of codes:



  • 2xx — the request was successful — the server successfully sent the requested document to the client

  • 3xx — the request was successfully redirected — is also a positive code. It says that the client's request has been redirected. It is used when working with caching servers, as well as in the algorithm when the client's browser checks the relevance of the document on the server (creation date, size, and so on)

  • 4xx — error — the document was not sent to the client because a critical error occurred. For example, the requested document was not found on the server, access to the document is denied, and so on

  • 5xx — server error — critical error on the server. For example, the user's script could not work properly on the server