New Webmasters > Reference > What Do Those HTTP Errors REALLY Mean – 4xx Errors Examined

What Do Those HTTP Errors REALLY Mean – 4xx Errors Examined

Every request to a web server is returned with a HTTP status code. Mode of the time that status code is 200 – everything is OK. There are, however, quite a variety of error codes that can be returned, besides the famous 404 error. This article will look at all the 4xx error codes that can be returned by a web server. There are other status codes that can be returned but we are only concerned with errors. The W3.org protocol website has a full list. You can also learn all about server 5xx errors in our related article.

We will use simple terminology as often as possible to explain the errors. In the explanations when we refer to “web browser” we are technically referring the what the specification calls the “client.” We will also use the term “page” when we really should use “resource.”

400 Bad Request

The web server thinks there was an error in the syntax that the browser used to request access to the page. The request did not meet the appropriate HTTP specification. This is caused by a software error in either the web browser or the web server itself.

401 Unauthorized

Authentication in Internet Explorer

Authentication in Internet Explorer

To access this page, your web browser must supply access credentials (usually name and password). If you get this error after supplying a username and password, then the server has rejected those details.

402 Payment Required

This error message isn’t actually used and the W3 describe it as “reserved for future use.”

403 Forbidden

The default Apache 403 error

The default Apache 403 error

This message is given when a webmaster wishes to prevent a user from accessing a certain area of a website. You will most commonly encounter this error when trying to browse a directory index. It is different from the 401 error as nobody is able to access this page; it is not a username/password error. Note, however, that the web server does not have to provide a reason for refusing the request.

Some people think this error message is a little messy so prefer to return a 404 error when a user tries to browse a directory index.

404 Not Found

The most common error message found on the Internet. You have attempted to access a page which does not exist. It may or may not have existed in the past, but you cannot tell from this error message.

As this error message is so common, most web browser return their own version of the 404 error page if they detect that the default one is being returned.

405 Method Not Allowed

The HTTP specification describes what are known as “methods” for accessing a page. The most common ones are GET and POST, but there are a few others as well. A web server can be configured to allow or reject any of these methods. When you attempt to use an unacceptable method to access a page, this is the error you will encounter

Please note that “method” refers to the HTTP request method only. It has nothing to do with the web browser you are using, or anything related to that.

406 Not Acceptable

When a web browser makes a request for a page, it is able to tell the web server the characteristics of the data it can accept back.

For example, the web browser can tell the server it will only accept certain character encodings or certain languages. If the server is unable to comply with the request, then it will return a 406 error.

In all probability you will never encounter this error as web browsers tend to accept data in any format from a web server.

407 Proxy Authentication Required

This error is returned when the request for a page is required to be routed through a proxy server which requires some type of authentication.

Web servers must be specifically configured to require proxy authentication, so it unlikely you will see this error without knowing about it first.

408 Request Timeout

As the name suggests, a 408 error means that the web server is not willing to wait any longer to send the requested page to the browser. If this occurs, take a look at the server load, especially if the error is returned quite frequently. These error may be returned in clusters at a certain time of the day when your site traffic is quite heavy. The only way to resolve this error is to make upgrades to your web server, but only if it becomes a problem.

409 Conflict

This error is quite rare and it means that the connection that is being established conflicts with another rule already defined by the server.

The HTTP specification states that the server should return a reason for the conflict. The user should then be able to resolve the problem and request that page again.

These types of errors are very rare and should never happen in a web browser.

410 Gone

Similar to the 404 error, the 410 error indicates that a page is not present on the web server. It differs to the 404 error in that the page used to exist, but it doesn’t any longer. If the page has been moved to a different location you should redirect it automatically.

The 410 error is only for pages that did exist at some point in the past but have been permanently removed.

411 Length Required

A request to a web server can send a header called “Content-length” which defines how long (in bytes) the content of the request is. If the server requires this header but the web browser does not send it, then this error will be returned

This situation usually only occurs when data is being placed on a web server, rather than being retrieved from it. For this reason a 411 error is very rarely ever encountered when using a web browser.

412 Precondition Failed

The web browser set a “condition” for access that the server failed to meet, so the connection was refused.

413 Request Entity Too Large

This error means that the connection to the web server consisted of too many bytes, ie. it was too large for the server to process.

A web server can be configured to accept different size requests under different circumstances, but very few requests will ever be too large for the server to process them. It would typically occur when you try to upload a very large file with the PUT method. The size of a request from a web browser will only ever be relatively small, so this error should seldom be seen.

414 Request-URI Too Long

Web servers typically allow URL lengths up to a few thousand characters long. If this limit is ever exceeded, a 414 error will be returned. The size limit can be configured for each web server.

As with most of these errors, this particular one will not be returned very often as most URLs are relatively short. You are most likely to encounter it if a hacker is trying to find a security vulnerability on your web server.

415 Unsupported Media Type

This error indicates that the media type that was requested by the web browser was different to that returned by the server. Again, it will very rarely happen with a web browser as most will attempt to process any type of media returned by the server.

If the browser is specifically requesting a particular format of file and the server believes that the format is different to that specified, this error should be returned.

416 Requested Range Not Satisfiable

When a browser requests a file from a web server it is able to specify a file size (known as content-length and measured in bytes). The browser is also able to request an “offset” of bytes (set by the “range” header). If the range of bytes requested is not compatible with the size of the file, then the 416 error should be returned.

For example, if a file is 10,000 bytes long and the web browser requests bytes 5,000 to 12,000 the server will be unable to process this request and a 416 error will be returned.

417 Expectation Failed

A web browser is able to send a “expect” header which states certain conditions that the web server must meet. If the server cannot meet this condition, it should return the 417 error.

So there are all the 4xx errors that your web server can return as defined in the HTTP 1.1 specification.

Share this page with others
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • blogmarks
  • Propeller

Related Articles

Discussion

2 comments for “What Do Those HTTP Errors REALLY Mean – 4xx Errors Examined”

    Trackbacks / Pingbacks

  1. What Do Those Server Errors REALLY Mean - 5xx Errors Examined | New Webmasters | December 5, 2008, 8:21 am
  2. How Good Are Search Engine 404 Error Pages? | New Webmasters | September 22, 2009, 8:27 pm

Post a comment