HTTP status codes are a set of guidelines for how networking should work between systems sharing information. Most of us are familiar with 404 – because that’s what we see when we try to visit a page that’s no longer there. These codes are sent from the server where the website you’re visiting is hosted, to your computer. Many of them are created by errors accessing the website, rather than something that’s an issue with your computer or your web browser.
Web designers run into many of these status codes, as they should, since they were created for the benefit of designers and developers. Using the specific error codes, it’s much easier to debug to find the problem and fix it.
As a regular web user, most of these don’t matter to you – but educating yourself about them can help you know the difference between a problem with your web browsing, and a problem with a website your visiting. As a marketer, it helps to know some of these codes for SEO purposes – particularly those in the 300, 400, and 500 classes.
Without further ado – let’s take a look at all the codes and what they mean.
100 Class: Informational Status Codes
The 1xx codes are limited, because they represent operation at the connection phase. They’re sent during the connection, so they’re not the final status for the connection. These codes were not part of the first version of HTTP, and were added when 1.1 was adopted.
- 100: Continue: This code signifies the initial response has been received and the full request will continue. You typically won’t see it when debugging, but will find it associated with most requests.
- 101: Switching Protocols: This code comes into play when the server switches protocols to a different version of HTTP.
200 Class: Successful Request Status Codes
All of the 2xx codes mean the server requests are successful. The response varies based on the type of information sent, but regardless all codes represent a successful connection and receipt of information.
- 200: OK: This just means the connection request was successful and the connection was made. Typically, it’s sent with a GET request to return some kind of information.
- 201: Created: This code is a successful request after a new resource is created, like an HTML webpage.
- 202: Accepted: The connection to the server was successful, but the response hasn’t been processed yet. It’s left open for other connections while an accepted response is processing.
- 203: Non-Authoritative Information: This is similar to the 200 OK response, with the exception that the return information is coming from a different server. You may see this when you’re pulling from API data, or using a remote database or server farm.
- 204: No Content: The connection to the server was successful and the information was accepted, but no information was returned from the server. There are several reasons this can happen, but all of the data transfer typically happens in the meta header.
- 205: Reset Content: When someone submits content to the server, sometimes it will request a reset of the original document. You’ll see this status code from the server to the client when the document needs to be updated or reset.
- 206: Partial Content: When you get this status, this is a partial response. It generally happens when there’s cached page content and the user only needs part of the page refreshed.
300 Class: Redirection Status Codes
The 3xx codes propose an update on the client’s side or a connection refresh. These codes relate to your web browser, but the refresh is usually automatic to adjust for new uniform resource identifier(URI) structures. When poorly implemented, the redirects can cause infinite loops, leading to constant refreshes until the server quits. If you’ve ever seen a “too many redirects” notice in your browser when a website refuses to load, these are the codes you’re dealing with.
- 300: Multiple Choices: If the resource has moved to multiple locations, you’ll see the 300 status code with a list of options where you can obtain the requested webpage or resource.
- 301: Moved Permanently: If you’re a web developer, you likely have some knowledge of this code. It is used to indicate a resource has permanently moved from one location to another, and is essential for changing a website from one domain to another, or making changes to a website’s URL structure. If you update a URL in WordPress, it creates a 301 redirect onto the old URL. If you’ve got a WordPress website, there are many plugins available to manage 301 redirects.
- 302: Found: This is similar to a 301, but instead of being a permanent move, it’s a temporary move. So, when used, it tells servers the original URL is still active.
- 303: See Other: When you see this code, the request successfully connected, but the response is found at a different URI. Each code should include the response URI in the header.
- 304: Not Modified: If you’re loading a resource through cache, it will check to see if the document has been re-cached or updated since a certain period. If it hasn’t changed, the 304 means the content has stayed the same. This saves on bandwidth as cached resources don’t need to be sent over HTTP over and over again.
- 305: Use Proxy: This represents a forced proxy connection. If there’s a webpage or other resource that can only be accessed through a proxy server, the 305code will return with a location header that contains the proxy URI.
- 306: Unused: This code is not used in current HTTP versions, but was once used in older versions of the protocol.
- 307: Temporary Redirect: This is similar to the 302 as they both represent temporary location changes. But, the 307 is more apt to handle continual updates to new URIs, on a more frequent basis, even though 302 could do it, too. At least where the general user is concerned, they are the same.
400 Class: Client-Side Error Status Codes
4xx codes represent client-side errors, which are generally the fault of designers and developers. However, not all of them are your fault, so there’s no need to panic or feel guilty. Instead, use them as an indication that something has gone wrong, and the fix is likely on your side, rather than the server side. The majority of these codes will also return information about the error so you can determine which page or resource is the cause of the error. Some messages will also indicate whether it is a temporary or permanent problem.
- 400: Bad Request: This just means the server couldn’t understand the request, and its usually a result of a syntax error in the URI.
- 401: Unauthorized: If you’re trying to access a file that is password protected with information stored on the server, and don’t have the right username/password, you’ll get this error.
- 402: Payment Required: As of right now, this is not in use, and seems to be reserved for use in the future.
- 403: Forbidden: This is much like the 401, except you cannot grant yourself access. This usually happens when a webmaster blocks certain folders or files from being visible over HTTP.
- 404: Not Found: When you get this error, the page or resource can’t be found at the current location, and has no redirect or known location in place to direct you to where you can find the file. It’s a sign the file has been moved or deleted from the server.
- 405: Method Not Allowed: This status code is associated with the backend development of a website. It means the request method cannot be accepted, with the most common ones being GET and POST.
- 406: Not Acceptable: This relates to how information is returned. The server accepted the information, but the response cannot be sent. This typically happens when the client or browser doesn’t support the response.
- 407: Proxy Authentication Required: This is similar to a 401, but it requires authentication though a proxy server.
- 408: Request Timeout: Servers are programmed to wait a certain length of time for a response from the client server. If the connection takes too long, you’ll get this error. Sometimes, this can be fixed by waiting a minute or two and then refreshing the page.
- 409: Conflict: You’ll get this error when the requested resource needs to be edited, but doesn’t have the permission to do so. If a file should be moved or deleted but the connection doesn’t have permission, this status will come up.
- 410: Gone: This is more specific version of the 404 code. It means the resource has permanently moved and is not expected to return to the URI, but there is no indication of where it may be found in another location.
- 411: Length Required: Though rare, this deals with the “content-length” header. Some return content may require a certain length before the request can complete. If you get this error, fix it by passing a content-length header into the request.
- 412: Precondition Failed: If some information passed into the request-header is incorrect, you’ll see this code. The server evaluates the information and will often come back with a message that helps you see where the issue is.
- 413: Request Entity Too Large: If the request is more than the server can handle, you’ll get this return code. Your server setup should dictate the largest possible file size, and you won’t see this if you don’t exceed that size.
- 414: Request URI Too Long: The URI passed to the server is too long, you’ll see this error. Though not common, if there are too many parameters attached to the end of an URL, it may be too long. The only way to fix it is to address the website’s code.
- 415: Unsupported Media Type: This is also a rare one, but it can appear if you’re passing data that can’t be supported by the server. You’ll see it if you’re using an unsupported audio or video file type, for example.
- 416: Requested Range Not Satisifiable: This happens when the range request header doesn’t get a long enough response from the server. This happens when the server can’t access the full range of data.
- 417: Expectation Failed: When you see this error, the expect request header cannot be handled by the server. The responses are vague, so it can be difficult to address this error code.
500 Class: Server-Side Error Status Codes
All 5xx codes represent errors on the server’s end of the connection. Some of them may provide additional information, but they’re not always understandable from the user’s end. Think of these errors as serious issues to address with the server administrator or your web hosting company.
- 500: Internal Server Error: Chances are as an internet user, you’ve seen this at least once in your life. It means there’s an unknown error on the server and it cannot complete the request.
- 501: Not Implemented: If the sent request to the server contains a functionality that’s not installed, you’ll get this error in turn. This can happen for several reasons, including a lack of software or backend languages.
- 502: Bad Gateway: This error is more common in large networks. If a server can’t be connected or is invalid, then you’ll get a bad gateway error. It’s a complex networking issue and has nothing to do with the client.
- 503: Service Unavailable: When this happens, the server is either down for maintenance or overloaded with traffic. The server can’t take on anymore connection requests.
- 504: Gateway Timeout: In this case, your connection is successful, but the server is acting like a proxy and that response is taking too long. Sometimes you can fix this by waiting a minute or two and then refreshing.
- 505: HTTP Version Not Supported: If you send a request with an unsupported version of HTTP, you’ll get this code. You should also see a message that tells you which versions are supported.
Status Codes are Essential, But Not for Everyone
You don’t have to memorize these codes, but as a designer or developer, it may be helpful to do so. Chances are unless you’re in the field and working with HTTP every day, you’ll never see any of these codes.