Common HTTP Errors

Every HTTP transaction has a status code sent back by the server to define how the server handled the transaction.
Apart from the 404 error, how many other HTML error pages do you know about? Have you ever thought about what happens in the background when you see any of these HTML error pages on your screen?
Those codes are meant to convey important information to the user. Using them properly reduces your bounce rate, improves your search engine ranking and gives you knowledge on the performance of your site.

Status Codes

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
5XX 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.

Lets see some Client side and Server side HTTP error codes

Client Side Errors(4XX)

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.

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.

401 – Authorization Required

When there’s a password-protected webpage 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.

403 - Forbidden

The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.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.

404 - Not Found


The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

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 time frame it was prepared to wait.

410 - Gone

The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval.

If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 Not Found SHOULD be used instead. This response is cacheable unless indicated otherwise. It’s a good idea to distinguish between 404 and 410 to enhance your Google-friendliness. 

Server Side Errors

500 – Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.
If you encounter the 500 error page on your own site, it will be wise to contact your hosting provider. The reason is most likely a permission error, a corrupt .htaccess file or a too low memory limit.

502 – Bad Gateway

The 502 error message represents a communication problem between two servers. It occurs when the client connects to a server acting as a gateway or a proxy that needs to access an upstream server that provides additional service to it.

503 - Service Unavailable

Your web server is unable to handle your HTTP request at the time. There are a myriad of reasons why this can occur but the most common are:
  • server crash
  • server maintenance
  • server overload
  • server maliciously being attacked
  • a website has used up its allotted bandwidth
  • server may be forbidden to return the requested document
  • This is usually a temporary condition. Since you are getting a return code, part of the server is working. The web people have made the server return this code until they fix the problem.
If you do not get service back soon, contact your web host as they would know the best. Some web hosts have server status pages you can check.

504 – Gateway Time-Out

There is a server-server communication problem behind the Gateway Time-Out error message, just like behind the 502 Bad Gateway error code. When the 504 status code is returned there’s also a higher-level server in the background that is supposed to send data to the server that is connected to our client. In this case the lower-level server doesn’t receive a timely response from the upstream server it accessed.

Want to learn Web Programming?

Comments

Popular posts from this blog

How E-commerce Sites can Increase Sales with Pinterest?

Every thing U can do with a Link-List + Programming_it_in_JaVa

Test Your SQL Basics - Part_1