HTTP Server Errors Explained

HTTP Errors

I’m sure nearly everyone has stumbled upon a HTTP response status code of some kind, whether it’s in the form of a 404 not found page, a 403 forbidden page or one of the many others. In this quick tip I will explain what the most common HTTP Response Status Error Codes represent, the cause of the error and how to resolve it.

A HTTP response status code is sent from a server via HTTP to a client computer, everytime a client makes a request to the server — an AJAX operation, a web page request, etc. When requesting a web page and the page is returned successfully, a HTTP response status code is not displayed by the browser (even though the response status of 200 OK or maybe a 301 Redeirect has been received). A web user would usually only see the status code if there was an error relating to a URL request.

HTTP response status codes are categorised into five classes. Each class has further sub categorised status codes. The first digit in the status code specifies the class. The following two digits specify more accurate infomation about the response status. In this post I’ll be going over the most common types of 4xx and 5xx error codes.

4xx HTTP Client Errors

400 Bad Request
The file request could not be understood by the server due to bad syntax. This usually means the syntax used in the URL is incorrect. There can be several reasons for the incorrect syntax. It could be something as simple as uppercase letters should be lowercase letters or wrong punctuation marks. You could try clearing your cookies, browser cache and browsing history. If you get the error on lots of web sites, this indicates the URL is most likely being modified somewhere between submitting the request and reaching the server. If this is happening, try updating the browser or try another browser, or disable / remove any third-party cacheing or ‘web accelerator’ software you installed.
401 Unauthorized
The wrong or no username and / or password was submitted. The username and / or password was possibly mistyped or does not exist on the server. If retyping doesn’t work try contacting the server administrator to discover if the username and / or password exist.
402 Payment Required
This HTTP response status code is currently not in use. Classed by the W3C as reserved for future use.
403 Forbidden
A fundamental access problem, which may be difficult to resolve because the web server gives the 403 error response without providing any reason at all. The most common reason for this error is that directory browsing is set to no on the web server. The web site wants you to navigate using the URLs in on the web site, and not browse the web site’s file directory hierarchy. Try adding commonly used suffixes to the url, or navigate using the web site’s links.
404 Not Found
Probably the most common error, and basically means no file exist at the requested URL. The file might have been either moved, deleted, never existed, or has a different URL or document name. Ways to resolve this include looking for words that look misspelled and correcting them, backtrack by deleting information between each backslash eventually arriving at a page on that site that isn’t a 404 – From there you may be able to navigate to the page you’re looking for. Sometimes a slight variation of the URL might be accepted. For example, If the url was http://www.website.com, it might be attempting http://www.website.com/ or http://www.website.com/index.html.
405 Method Not Allowed
If you receive a 405 error status code you are most likely trying to send some kind of input form on the Web site, but not all servers allow the POST method necessary to process the form. All 405 errors can be traced to the configuration of the Web server and security governing access to the content of the Web site. This issue is usually responsibility of the server administrator.
407 Proxy Authentication Required
Access to the URL requires the use of a proxy server that needs some authentication, which has not been provided. This means you must log in with the proxy server first. This can often be resolved by navigating to the URL through another way e.g. accessing another URL for the proxy server first.
408 Request Timeout
The request took longer than the server was prepared to wait. This usually occurs when servers are slow or file sizes are large. Try again at a later time. If there is still no success, the issue is more than likely the file size of the request.
409 Conflict
This error is usually application-specific conflict, not cause by the HTTP protocol itself e.g. If you’re trying to upload a file, and receive a 409 error it might be because the file attempting to be uploaded is an older version than the copy already there — resulting in a version control conflict.
410 Gone
The 410 error indicates that the URL used to exist. The web server has no forwarding address for the URL, so no redirection (3xx status code) can be provided. This should generally be considered permanent, unless later changed to a 404 status code by a server administrator.
414 Request-url Too Long
The URLs in this case are typically standard hyperlinks found on Web pages. These links tend to be too large if they are simply wrong and has been badly coded.

5xx HTTP Server Error

500 Internal Server Error
The server has encountered an unexpected condition which prevented it from fulfilling the request. Something is wrong with the server’s configuration and it could not retrieve the file, but the server can not be more specific about the issue. The web server would generate an internal error log, giving more information about the error. It is up to the operators of the web server to locate and analyse these logs, to resolve this issue.
501 Not Implemented
The server does not support the facility required to carry out the request. It is likely if the client being used is not a web browser and the web server is old. Possibly the web server is either responding incorrectly or needs to be updated.
502 Bad Gateway
the communication (protocols) between the server and another internet services are not compatible. Only the network / server administrators can fix this problem. The only option is usually to try again at a later time.
503 Service Unavailable
This is a temporary server issue. The server cannot currently handle the request due to temporary overloading (to many concurrent requests) or server maintenance. The only option is to try again at a later time.
504 Gateway Timeout
This problem is entirely due to slow communication. The server is attempting to access another internet service which is not responding within a time that the server was prepared to wait (usually left at a default setting of 90 seconds). Only the network / server administrators can fix this problem. The only option is usually to try again at a later time.
505 HTTP Version Not Supported
The server does not support, or refuses to support, the HTTP protocol version that was used in the request message. The server is indicating that it is unable or unwilling to complete the request using the same version as the client. At the request of the W3C the response status should describe why that version is not supported and what other protocols are supported by that server. Try to access the URL using a more up-to-date web browser or application.

David AnastasiWritten by David Anastasi - A web designer and front-end web developer based in Southampton, UK. David Anastasi on Twitter