Most common HTTP status codes

by PM

Posted on Tue Jun 18 14:17:51 GMT 2019

View of Cula
HTTP status codes - what do they mean, what to do? CULA

Sometimes while surfing the Internet the website you want to reach is unavailable and gives a HTTP error with a unique code assigned to it. Each and every one of us has seen 404 at least once in our life, right?

The three-digit error message contains important information for all Web Masters, what exactly went wrong on the web server side. When a server receives HTTP request, it always sends back response status - it's called request-response system. If you don't have the Internet access, you won't receive any response code, as none request will be sent to the server - connection will just time out. It may be, that the error was caused by user actions and the fault is not on the server side, but more on that later.

From the administrator's perspective - knowing the particular error code helps to save time&money while encountering a problem. They are grouped in classes, which are represented by the first digit. So, if 1xx is displayed, that means we see an inforational response. Success ones are starting with 2xx and redirection ones with 3xx. Finally, we've reached two error types. HTTP status code with digit 4 as first means that we have a client error (like mistyped URL address), while 5 indicates that the issue lies on the server side. Majority of error codes starting with 4xx can be fixed by server configuration. It doesn't always have to be user's fault, even if this type is client-related. If the code starts with 5xx we already assume that the problem lies on the server side (it can't process the request).

There are dozens of error code types, but we'll cover only the most common ones. You can always check out the full list in Wikipedia

404 not found

It may be the result of mistakenly typed URL - one additional or missing letter, wrong domain name or just a typo can cause the server response to tell us that the site we want to access does not exist. The age of the site may be also a root here. For example, if you've linked to a specific resource in a past - it may not exist anymore or no longer be available. Better safe than sorry - it's wise to keep all your URLs up to date. That error code may be also telling us that the webmaster moved the page to another address or deleted it.

403 Forbidden

If you see this message most probably the owner doesn't allow the visitors to browse that specific part of the site (or whole). In that case scenario server is rejecting your requests. There is a whitelist of machines maintained on the server, which have an access to the website. Any connection attempt from the machine not listed in there will result in 403. Notice, that this is not the problem of authentication.

401 Unauthorized

Similar to the previous one, but now the problem lies in the failed authentication. The credentials provided must've been invalid. The exception is the situation, when IP address of the person which is trying to enter was banned from the domain.

504 Gateway Timeout

This is more like a communication problem between one server and another. If you see such code, it means that the additional server, from which the server you're trying to connect to should collect some data, is not responding. The time estimated for such action is too long and the 504 is sent to the end user - it tells us that the backend server performance is poor. It can be solved only by webmasters who are handling the maintenance of the network infrastructure (or you can just wait for a while and try again).

503 Service Unavailable

Most probably only a temporary problem on the hosting provider side. Maybe the server was just restarted due to the maintenance works and is initializing at the moment. It's hard to guess, may it be that there were too many visitors on the site and the server just couldn't handle any more new ones. The other idea worth checking is usage of the CPU or the memory of the server. Maybe the number of requests have gone too high and the upgrades are needed so more processes could be handled.

502 Bad Gateway

The problem almost for sure lies on the upstream server, which is not fulfilling the request for gateway or proxy server. In other words - the server 1 is receiving an invalid response from server 2 (so a similar one to repose code 504).

500 Internal Server Error

Is the response code which is called as a general-purpose, generic one. Basically, every other 5xx code can be hidden behind it (or just lazy-coding from the developer side). If you try to refresh the page, you might get a more specific code. There is also a chance that no other code was suitable for this situation (most possibly server misconfiguration or missing packages).

To sum up, even if you're not a webmaster, it is worth the effort to acknowledge the meaning of most common HTTP error codes, so you can act quickly in an even of your website downtime.

With a free account in the systems like CULA.IO [] you can be the first one to know, whenever your site is down and is sending back the HTTP error codes to the visitors. The tool sends an immediate alert on up to 5 email addresses, Slack, Pushover or Discord communicators and is completely free of charge. Never let your site surprise you and your visitors with a long downtime - the consequences might be irreversible!

Cula, Katowice, Poland