Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Error codes- Client-Side Errors (4XX)  (Read 2614 times)

0 Members and 1 Guest are viewing this topic.

anandhuo

  • Guest
Error codes- Client-Side Errors (4XX)
« on: August 05, 2017, 01:00:07 pm »
Behind every error page, you see on the web there is an HTTP status code sent by the web server. Status codes come in the format of 3 digit numbers. The first digit marks the class of the status code:

    1XX status codes have informational purposes
    2XX indicates success
    3XX is for redirection

None of these three classes result in an HTML error page as in this cases the client knows what to do and goes on with the task without hesitation. What we usually see are the 4XX and 5XX kind:

    4XX represent client-side errors
    5XXs indicate problems on the server side

HTML error pages are displayed in these cases because the client has no idea about what how to move on. Let’s see what happens in the background when something goes south and what you can do about it.
 
Client-Side Errors (4XX)
--------------------------------

1. 400 – Bad Request
     
Whenever the client sends a request the server is unable to understand, the 400 Bad Request error page shows up. It usually happens when the data sent by the browser doesn’t respect the rules of the HTTP protocol, so the web server is clueless about how to process a request containing a malformed syntax.
When you see a 400 error page the reason is most likely that there’s something unstable on the client side: a not sufficiently protected operating system, an instable internet connection, a defective browser or a caching problem. So it’s always a good idea to test a bit your own PC before you contact the owner of the website.

Open the same webpage in a different browser, clear the cache, and check if you are due with security updates. If you regularly meet the 400 error on different sites, your PC or Mac is awaiting a thorough security checkup.

2. 401 – Authorization Required

When there’s a password-protected web page behind the client’s request, the server responds with a 401 Authorization Required code. 401 doesn’t return a classical error message at once, but a popup that asks the user to provide a login-password combination.
401

If you have the credentials, everything is all right, and you can go on without any problem and get access to the protected site. Otherwise you are redirected to the Authorization Required error page.

If you are a website owner, you can add the same password-protection to your site or a part of it through your cPanel account.
Password Protection in cPanel

Click on the “Password Protect Directories” submenu inside the “Security” menu box and choose the web folder you want to protect. It can be a good security layer to restrict access to your admin area like the wp-admin folder in a WordPress site.

3. 403 – Forbidden

You can encounter the 403 Forbidden error page when the server understands the client’s request clearly, but for some reasons refuses to fulfil it. This is neither a malformation nor an authorization problem. By returning the 403 status code the server basically rejects the client with a big loud “No” without any explanation

The most common reason is that the website owner doesn’t permit visitors to browse the file directory structure of the site. When this kind of protection is enabled you can’t access folders directly on the website. The other frequent reason is that the specific file the client requested doesn’t have the permission to be viewed from the web.
403

You can set 403 protection for security reasons on your own site. It can be useful to harden your site against being hacked by hiding the directory structure or files that contain vulnerable information.

Luckily many web hosts provide this service to their clients by default, but if you want to add an extra security layer, open your cPanel account, navigate to the Advanced menu box, and click on Index Manager.
Index Manager in cPanel

Here you can customize how your visitors view a specific directory on your site. If you choose No Indexing the client will receive an 403 error page if it tries to access the given directory.

4. 404 – Not Found

404 is the most well-known HTTP status code out there, and you have surely read many great posts about how to customize 404 pages. The browser returns a 404 HTML page when the server doesn’t find anything on the requested location.

There are two main scenarios that can result in a 404 Not Found page. Either the visitor mistyped the URL, or the permalink structure of the site has been changed and the incoming links point to pages that were moved to different locations. 404 error pages sometimes can appear on top level URLs too. It usually happens when a site has recently moved to another web server and the DNS still points to the old location. This kind of problem usually disappears after a short time.
404

You can find SEO experts on the web who claim too many 404s have a negative effect on your site’s search engine ranking, but Google claims that “404 errors don’t impact your site’s ranking in Google, and you can safely ignore them” as 404s are seen as a normal part of the web by the search engine.

You may want to reduce the number of your 404s because they increase the bounce rate (people who leave immediately) of your site. The most common solution for this is using 301 redirects for permanently removed pages, and 302s for those that are temporarily unavailable.

5. 408 – Request Time-Out

When the request of the client takes too long, the server times out, closes the connection, and the browser displays a 408 Request Time-Out error message. The time-out happens because the server didn’t receive a complete request from the client within the timeframe it was prepared to wait. Persistent 408 errors can occur because of the heavy workload on either the server or on the client’s system.
408

In some cases both ends of the connection work properly but a temporary internet surge slows down the delivery of the message. Bigger websites tend to customize 408 error pages just like most of you do, in case of 404s. 408 errors can usually be fixed by reloading the page with the help of the F5 button.

6. 410 – Gone

The 410 Gone error page is very close to the well-known 404. Both mean that the server doesn’t find the requested file, but while 404 suggests that the target file may be available somewhere on the server, 410 indicates a permanent condition.

410 shows the client that the resource was made intentionally unavailable, and the website owner wants incoming links to be removed from the Web. 404 is used when the server is unsure if the unavailability of the file is permanent, but 410 always indicates a complete certainty.
410
« Last Edit: August 05, 2017, 01:05:13 pm by anandhuo »