Do you know the meaning behind a 404, 500, or 503? We are not talking about area codes here; these are all common error codes that sometimes show up in the browser when visitors are trying to access your website. Some codes demand more serious action while other codes are informative and do not require immediate attention. Do you know which are which? In this article we will discuss some important information in the HTML error codes that appear on the screen when something goes wrong.
What Are Status Codes?
HTTP status codes are 3-digit numbers sent by the web server to provide browsers with information about the status of the webpage.
The first digit hints at the class of the status code:
- 1XX is for informational purposes
- 2XX shows success in accepting request
- 3XX signifies redirection, without any interaction with the user
These three codes are not game-stoppers. None of them result in an HTTP error page and typically the client is aware of the action they need to take in order to resolve the problem. However, HTML error pages are displayed when the error codes are of the 4XX and 5XX kind:
- 4XX implies client-side errors
- 5XXs reveal server-side problems
Here is a guide outlining the most common website error codes along with the meaning behind the errors.
Client-Side Errors (4XX)
When the client has erred, the 4xx class of status code is served and contains the error situation and information on whether it is a temporary or permanent condition. Some of the more common 4xx errors that you will see include:
400 – Bad Request
A 400 error page shows up when the client sends a request that the server cannot understand due to malformed script or when the browser does not respect the rules of the HTTP protocol while accessing the website.
Since the 400 error page indicates something unstable on the client side, it may be wise for users to repeat the request after testing some modifications like clearing the cache, opening the page in a different browser, or running security updates.
401 – Authentication Required
A 401 error appears when a visitor tries to access a password-protected web page that they are not authorized to view. When trying to access a restricted page, a popup appears for the user to provide a login name and password combination. The 401 code comes up along with relevant diagnostic information, only when the authorization credentials are refused.
Website owners can add password protection as a security layer for certain web folders they want to protect, such as access to the admin area.
403 – Forbidden
The 403 Forbidden error page is displayed when the server understands the request but refuses to fulfill it because the user is trying to access a directory, file, or script without appropriate permissions. You may also encounter the 403 error code due to invalid index files and empty directories too.
The website owner may choose not to index or permit visitors to browse the file directory structure of the site for security reasons. Enabling this kind of protection hardens a site against hackers trying to access the directory structure or files containing vulnerable information.
404 – Not Found
A 404 error is the most common HTTP status code that appears when a visitor tries to access URLs that do not exist. The server may not find anything matching the requested URL because of changes to the permalink structure of the site, an invalid or mistyped URL, missing files, or redirects to deleted or non-existent pages. 404 error pages can also appear when a site has been moved to another web server but the DNS still points to the old location. This is a temporary problem that disappears soon enough.
It is possible to avoid 404 codes by using 301 redirects on web pages that you have permanently deleted and 302’s for any temporarily unavailable page.
408 – Request Time-Out
The browser displays a 408 error code when the server times out and closes the connection because the client took too long to produce a complete request. The error message appears when the client request is not received by the server within the timeframe it is prepared to wait.
408 errors commonly occur due to temporary internet surges, heavy workload on the server or on the client’s system, which slows down the delivery of the request. The request can be repeated by reloading the page, without any need for modifications.
410 – Gone
The 410 error code makes an appearance when the server doesn’t find the requested file or resource and there is no known forwarding address. Unlike the 404 error code, this indicates a permanent condition.
The 410 response also notifies the recipient that the resource has been made intentionally unavailable. It is indicative that the site owner wants to remove all remote links to that resource from the web. Server owners should distinguish between 404s and 410s for the benefit of Google crawlers but it is not obligatory to mark all permanently available resources as gone.
Server-Side Errors (5XX)
Error codes starting with the digit “5” signify server error situations that render it incapable of performing the request.
500 – Internal Server Error
500 is a generic server-side error that is displayed whenever the server encounters any unexpected conditions that prevent it from handling the client request correctly.
If the server displays this type of error, there may be an error with the website coding, a permission error, low memory limit or an invalid .htaccess file. You can inspect the error log to look for an indication on which file is causing the problem.
With a WordPress site, even third party plugins can cause this error code. You can find the offender by deactivating your plugins, one by one, till you locate the one causing the issue.
502 – Bad Gateway
The 502 error message shows up when the lower level server acting as a gateway or proxy receives an invalid response from the higher level upstream server as specified by the URI, while trying to fulfill the client request.
The communication problem occurs when the proxy server or the local name server and the upstream server cannot agree on the protocol to exchange data. It can be due to the fact that one of the server machines is not configured or programmed correctly. This is easily fixable by your hosting provider.
503 – Service Temporarily Unavailable
When the server cannot handle the client request due to temporary overloading on the server or when there is a scheduled maintenance underway, the 503 error code shows up on the screen. The 503 error code usually means that the web server is temporarily unavailable and the condition is likely to be resolved after some delay.
The 503 status code is important for website owners in order to properly handle scheduled maintenance, without damaging the search engine ranking of the site. If there is a Retry-After header provided, the length of the delay may be indicated with the 503 code.
504 – Gateway Time-Out
The 504 error is similar to the 408 status code but in this case, the time-out does not happen between the client and the server, but rather because of communication problems between two servers in the back end. When there is slow communication between the two servers or if the higher-level upstream server is completely down, a Gateway Time-Out may show up.
To fix the server-side 504 error, the service providers must work on the network problem in the background.
Knowledge is Power
This blog addressed only a few of the more common http error codes. For additional information on the less common error codes and messages, you can look up the w3 site. If you are managing your own hosting account, knowing the error pages that your visitors can receive will help you take corrective measures to reduce your bounce rate, boost your search engine ranking, and improve the performance of your website. If you are working with a web hosting provider with managed services, this may be part of the benefits you get under that plan. Check with your provider for details on the partnership for managing such errors.