Every time you access a web server or an application, there’s an HTTP status code that goes out as a response to your HTTP request.
Technically these HTTP status codes are 3-digit codes grouped into five different classes, each of which could be determined by the first number.
Here’s what HTTP Status Codes’ class looks like.
- 1xx: Informational
- 2xx: Success
- 3xx: Redirection
- 4xx: Client error
- 5xx: Server error
While it is not that tough to kill these errors, but they seem quite frustrating initially.
Secondly, they won’t let the audience access your website, ultimately dropping down the traffic, which is a significant aspect of SEO.
In this read, we’ll talk about the most common HTTP error codes related to client and server errors and how you can easily troubleshoot them.
Let’s begin with a brief overview of client and server errors.
Brief Overview Of Client And Server Errors
Client errors codes start from HTTP status codes 400 to 499.
These errors occur as a result of HTTP requests sent by the user clients (web browser). Therefore, they can be resolved by tweaking the server configuration.
Server error codes start from HTTP status codes 500 to 599.
These errors are returned from the web server when an error has occurred or cannot process the client request.
Now that you have a better understanding of HTTP status codes let’s move down to our main point – Common HTTP error codes and how to troubleshoot them.
400 Bad Request
The HTTP 400 Bad Request error code means that the server was unable to process the HTTP request due to the malformed syntax or an invalid request message.
What Causes 400 Bad Request?
The most common reasons for this error include:
1. Incorrect URL, malformed syntax or a URL with wrong characters
2. Corrupted files in your browser cache
3. Trying to upload a file that’s too large to be fulfilled by upload request
How To Troubleshoot 400 Bad Request?
Errors are not good for any reason. So, you must fix them as soon as possible. Here are some ways to fix 400 Bad Request errors:
1. Checkout The URL
One of the most common causes for HTTP 400 error is the malformed URLs. Therefore, you need to check that before anything else.
Since it is quite easy to include unwanted characters in the URL, you need to ensure that the domain name and specific page you’re trying to access are correctly spelled.
2. Clear Your Browser Cache
Another common cause for the 404 error is the locally installed corrupted files. Here are some files that you must be in perfect condition:
- Text/config files
- Media (images, videos, audio)
- Data files (XML, JSON)
To clear your browser cache, you simply need to:
- Access your browser settings and navigate to Clear browsing data.
- Now hit the checkmark on the Cached images and files and click on the Clear Data button.
3. Compress File Size Before Uploading On The Server
File sizes that exceed the bandwidth allowed by the server would also result in 404 Bad Request.
To ensure this is the case with you, try uploading a smaller file and check if the error occurs.
If not, you need to compress the files you’re trying to upload on the server and resolve the error.
4. Clear The DNS Cache
When your DNS lookup data gets corrupted or outdated, you’ll see the 404 error. By clearing your DNS cache, you can get rid of this.
You can clear your old DNS cache from your system within the Command Prompt in Windows and Mac.
The 401 Unauthorized is the HTTP status code indicating that the server couldn’t authenticate the request sent by the client.
In simpler words, it means the user must provide the credentials to view the protected source.
What Causes 401 Unauthorized Error?
The most common reasons why you’ll face the 401 unauthorized error are:
1. Outdated browser cache and cookies, which prevent the authorization from going through
2. A firewall or security plugin mistaking your login attempt as a suspicious activity
3. Accessing an outdated link or an incorrect URL
How To Troubleshoot 401 Unauthorized Error?
Fixing the 401 Unauthorized error is simple and easy. Here’s what you need to do:
1. Checkout For The Errors In URL
It often happens that the link you used is the wrong URL and outdated one; it means you’re trying to access a page that doesn’t exist anymore.
The easiest way out here is to double-check if you spelled the URL correctly. Also, to access the page directly from the website to ensure that the link is not expired.
2. Clear Browser Cache
While the browser cache helps enhance your web surfing experience by improving website load times, it often causes some quite annoying interruptions.
401 Unauthorized is one of them. By clearing your browser cache using the method described above, you’ll be able to get rid of the 401 error.
3. Deactivate WordPress Plugins
If the 401 Unauthorized error is not coming from the browser, there’s a high probability that one or more WordPress plugins on your website are causing interceptions.
It generally happens with the security plugins. By deactivating these plugins, you’ll be able to access your website quickly.
1. Go to the Plugins section in your WordPress admin panel and click on the Installed Plugins.
2. Now select all the security plugins and hit the Deactivate button, and click on Apply.
404 Not Found
One of the most common errors from the client-side is the 404 Not Found status code.
It means that the user can communicate with the server but cannot find the targeted resource.
What Causes 404 Not Found Error?
If you are experiencing a 404 Not Found Error, it might be due to one of the following reasons:
1. Broken or dead links
2. Changes in URL but not redirection
How To Troubleshoot 404 Not Found?
Try using one of the following ways to fix the 404 Not Found error:
1. Update Your Website’s Permalinks
If you’re facing the 404 Not Found error on your entire website, then there’s a problem with your website’s permalinks.
To resolve this, all you need to do is to:
1. Go to your site’s Settings and navigate to the Permalinks settings.
2. Click on the Save changes (Saving changes is enough), and the error will disappear.
2. Setup Redirects For Moved Content
Even though WordPress sets up redirects by default for the moved content, this sometimes doesn’t work.
To resolve the error in this case:
1. Download the redirection plugin.
2. Go to the admin panel, go to the Tools and click on Redirection.
3. Enter the 404 error page URL in the Source URL box and enter the new location in the Target URL box.
It is worth remembering that you can use a free website analyzer tool to find all 404 pages on your website.
405 Method Not Allowed
Technically, the 405 method not allowed is an HTTP error code that indicates the server can recognize the request sent by the client, but the targeted source doesn’t support it.
What Causes 405 Method Not Allowed Error?
Some of the common reasons for encountering a 405 error are:
1. Wrong or misspelled URL
2. Recently updated WordPress version, website theme or plugin
3. Plugin making changes to your database
How To Troubleshoot 405 Method Not Allowed Error?
Here are a few tips to remove the 405 Method Not Allowed Error:
1. Check If You’ve Written The Correct URL
Like many errors from the client-side, error 405 not allowed may also occur due to the wrongly written URL.
Therefore, check if you’ve written the right URL or accessed the URL via the website only.
2. Revert Recent Updates Made To The WordPress
A new code from your WordPress update might be causing the 405 error. To see if this is the case, revert updates you’ve recently made to WordPress before getting the 405 error.
You should also get rid of all the extensions that you’ve added to the website. If the error resolves, you can find the other alternatives for these extensions.
3. See If There Are Any Changes In Your Website’s Database
A plugin may often modify your database records managed by WordPress, resulting in the 405 method not allowed error.
Uninstalling a plugin wouldn’t resolve this issue as it may not know how to revert the changes made in the database.
You need to go through your site’s database and manually look for the tables and records that the plugin has modified. Having your developer do this one would be a better option.
Now that you have a good understanding of commonly occurred client-side HTTP error codes, you must have a good basis for resolving them.
It is always a great idea to hire a website maintenance company to prevent the hassle. Experts will always be available to keep your site in perfect condition.
With that, you can keep sailing smoothly.
Do you experience any of the errors mentioned above frequently? If yes, what do you do to resolve them? Let me know in the comments.