HTTP status codes are responses issued for a client’s request made to a server. For example, when your client (your web browser) tries to connect to your site (the server).
Based on how the request is handled, the server shows different responses. These responses include redirects, server errors, client errors, and others as such. HTTP error codes are not part of web pages; instead, they are responses from servers about how the request is handled.
Not all HTTP status codes indicate errors. For example, some just communicate that a page has been moved, either permanently or temporarily. But if you are experiencing errors, the HTTP error codes that you see will help you figure out what the problem is.surfing online and trying to access a website, it is common to be presented with a HTTP error message. When you receive one of these codes, it is signaling a failure to provide you with entry to a certain page. To determine why this is and how you can resolve the problem, you need to pay attention to the type of error code you are provided with. Codes beginning with a four such as ‘4XX’ indicate an error from your end, whilst codes starting with a five (5XX) represent problems on the server side.
Some Common HTTP status codes are discussed below:
301 Moved Permanently
An HTTP 301 is when a specific webpage is permanently moved to a different URL. It’s not an error per se, but it does communicate important information.it can be on a page-level where you get pointed on another similar post (or even homepage for that matter) or a domain level.
Common Cause of Error:
- requested resource is invalid and that the request should be redirected to a new, “proper” URL
- it’s entirely possible that the server is misconfigured or bugged in some way
Quick Fix:
- Ensure your HTTP version redirects to your HTTPS
- Remove 301 redirects from your sitemap
- Avoid redirect chains
- Fix redirect loops
401 Unauthorized
A 401 Unauthorized error is an HTTP status code indicating that the server received an unauthenticated request. 401 error code responses are most often generated because of invalid credentials for a particular page or destination on your website. This status is typically sent with a WWW-authenticate header that contains information on how to authorize properly.
In human terms, this basically means that your client (e.g. your web browser) isn’t able to authenticate itself with the server and, as such, cannot view the resource. For example, a specific page might require a valid username and password to view.
The 401 error code, like other error codes in the 400-range, means there’s a problem on the client-side – AKA the problem lies on your web browser’s side (or another client), rather than the website you’re trying to visit.
Common Cause of Error:
- Incorrect URL – sometimes the 401 error code is because of the wrong URL. Make sure that the URL for the site you want to access has been entered correctly.
- Invalid login credentials – some pages of a website require you to login in order to access the information. If you’re not logged in, you will very likely get a 401-error. Make sure that the login credentials you are entering are accurate.
- False login requirement – this occurs rarely but, in some cases, a website that should not require a login will still show a login page. This indicates an issue on the admin side and will often throw up a 401-error.
- DNS errors – occasionally, domain name system failures may result in a 401 response. DNS malfunctioning is less common.
- Security/firewall issues –security plugins or firewalls can cause a 401 error if they detect malicious activity.
Quick Fix:
It could be possible the login URL has changed, or the URL you entered is incorrect. However, if that’s not the case, try clearing the browser cache and cookies.
403 forbidden
If you are presented with a 403 Forbidden message, the server is flat-out rejecting your request. The most common reason for encountering this message is that the website owner does not permit visitors to browse the website or you do not have the correct permissions to view the content. Unfortunately, the solutions to this problem are often out of your hands. In order to gain permission, you must speak with the website owner, whom will need to manually grant you access.
Common Cause of Error:
- Incorrect file or folder permissions
- Incorrect settings in the .htaccess file
Quick Fix:
- Check or reset/rename your .htaccess file
- Reset file and folder permissions
404 Not Found
The 404 error code means that the requested resource is no longer available. The user can communicate with the website’s server but it is unable to locate the requested file or resource.As the most common error code, there are a few checks you can perform to see if you can be directed to the page you were looking for. Look for typos, have you accidentally added a missing or extra letter to the URL? This can affect the server’s ability to find the page you’re looking for. Similarly, 404 error codes can arise if you are trying to access an old internet page. Old content is often moved to different addresses to keep it up-to-date. If you’re using the old address, you will be shown a 404 code so double check you are trying to access the most recent website.
Common Cause of Error:
- The URL or its content (such as files or images) was either deleted or moved (without adjusting any internal links accordingly)
- The URL was writtenincorrectly (during the creation process or a redesign), linkedincorrectly, or typed into the browser incorrectly
- The server responsible for the website is not running or the connection is broken
- The requested domain name can’t be converted to an IP by the domain name system (DNS)
- The entered domain name doesn’t exist (anymore)
Quick Fix:
- Reload the page
- Check the URL
- Go back through the directory levels
- Use the website’s search function
- Use a search engine
- Delete the browser cache and cookies
- Contact the website
410 Gone
This 410 Gone error is similar to the 404 response. Think of this as a permanent 404. When a webmaster decides to remove a post or page forever or republish it on another site, they can use this code.A 410 response tells Google the requested resource is permanently removed from the internet and will not reappear. This makes it easier to get the page de-crawled or de-indexed from Google.
Common Cause of Error:
- the resource no longer exists
- Platform changes
- Database changes
Quick Fix:
- check the input URL and make sure it’s correct.
- Check the configuration files for your web server
- Check the application logs
500 internal server error
500 Internal Server Error is the most common server error and is often referred to as the ‘catch-all’ code error. As a general-purpose error message, it is often the product of an unexpected fault which prevents the server from connecting you to your desired web page. For instance, you may see this error code if a website is receiving too much traffic and is therefore having difficulty granting you access.Although this is not a problem from your end, there are a few ways you can attempt to resolve it. Your first action should be to reload the page, in instances such as high web traffic, this can help the server fulfil your request. Failing this, clearing your browser’s cache and cookies (this can be done in your internet’s settings tab) before restarting the browser can be a quick and easy solution.
Common Cause of Error:
- Permission error: The permissions of the main files and folders are not set correctly.
- timeout: The script tries to access an external resource and experiences a timeout.
- Incorrect code in .htaccess: The structure in a .htaccess file could be wrong.
- Error in syntax or code in CGI/Perl scripts: In some cases, scripts are incorrect. Paths, especially, can be misaligned.
- memory limit: A process exceeds memory and therefore cannot be executed correctly.
Quick Fix:
- Turn on debugging
- Deactivate all plugins and switch themes
- Check your .htaccess file
- Increase your memory
- Ask your host
502 Bad Gateway
Unlike other HTTP error codes, 502 is different. A bad gateway occurs when one server on the internet receives an invalid response from another server. A 502 HTTP status code will be tacked on a screen when the server takes longer than expected to complete a request.
Common Cause of Error:
- issues between online servers that you have no control over
- an issue with your home networking equipment, or some other in-your-control reason
Quick Fix:
- Refresh the browser
- Clear the browser cache
503 Service Unavailable
The 503 Service Unavailable message can also be a temporary issue. If you see this message, it means that the web server is not available because of a temporary overload of traffic on the site or scheduled maintenance.
Simply reload the page or try again later and you may find the issue has resolved itself.
504 Gateway Timeout
504 Gateway Time-Out error message is a server to server communication problem. When your attempt to access a website returns this code, there is an additional background server which is supposed to send data to the server that you are connected to. In this case, the server does not receive this data in a timely manner and so issues a 504 code.
As 504 error codes are a network issue, only those with access to the network infrastructure can solve it. It is always worth reloading the page a few minutes later as this can sometimes provide a solution.