Skip to content
Related Articles
Open in App
Not now

Related Articles

How To Troubleshoot Common HTTP Error Codes ?

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 02 Jul, 2021
Improve Article
Save Article

It has happened to almost everyone many times that when we want to access any website, some coded message shows up on the screen indicating that we can’t access the website. These codes with error message are basically called as HTTP error code. HTTP (HyperText Transfer Protocol) is a process through which the client interacts with the server. When accessing a web server, every HTTP request i.e. received by a server is responded with an HTTP status code, which is of 3 digits and is grouped into 5 different categories. 

Series Begin With Code Indication
1** Informational
2** Success
3** Redirection
4** Client Error
5** Server Error
  • The series starts with 1**, 2** and 3** are fully functional requests and are discussed below.
  • The series starts with 4** represents client side error which are discussed below.
  • The series starts with 5** represents server side error and are discussed below.

Note: 4** and 5** is solvable by Troubleshoot. 
1** Informational: The HTTP status codes in this class are intended to be provisional, which is sent by the server before any full and completed second response is sent. 

  • 100 – Continue: This status code indicates that only a part of the request has been received by the server without any problem and client should continue the request or ignore the response if the request has already finished.
  • 101 – Switching Protocols: This status code is sent in response to an upgrade request header from the client and indicates the protocol which the server is switching to.
  • 102 – Processing: This status code is used to inform the client that the server has accepted the complete request but has not yet completed it.

2** Success: The HTTP status codes in this class indicate successful completion of a request. 

  • 200 – Ok: This HTTP status code is a standard response for successful HTTP requests. The information returned with the response is dependent on the method used in the request, like: GET or POST or HEAD or TRACE.
  • 201 – Created: This HTTP status code indicates that a new resource has been created as a result of the successful completion of a request.
  • 202 – Accepted: This HTTP status code indicates that the request has been received and has been accepted for processing but although it may not be processed immediately.
  • 203 – Non-Authoritative Information: This HTTP status code indicates that the request has been received and understood and the information sent back to the client as the response is from a third-party rather than from the original server.
  • 204 – No Content: This HTTP status code indicates that the server has successfully processed the request but needs to return any content or maybe there is no need to send back any data.
  • 205 – Reset Content: This HTTP status code is sent from the server to the client. It requests to reset the content from which the original document was sent.
  • 206 – Partial Content: This HTTP status code indicates that the server is sending only a part of the requested resource due to a range header sent by the client.
  • 207 – Multi-status: A multi-status response conveys information about multiple resources where message body is followed by an XML message and contains separate response codes.

3** Redirection: The HTTP status codes in this class indicates that additional action is required on the client-side in order to complete the request.  

  • 300 – Multiple Choices: This HTTP status code indicates multiple options for the resource that the client should choose one of them. It could be used to represent different file format options or different media presentations for the same content.
  • 301 – Moved Permanently: This HTTP status code indicates that the URL of the requested resource has been changed permanently to a new URL. The response should also include new URL and any future references to that resource ought to use the new URL.
  • 302 – Found: This HTTP status code indicates that the resource requested by the client has temporarily moved to a new URL. The temporary URL should be given by the Location field in the response.
  • 303 – See Other: This HTTP status code indicates that the response/resources can be found at another URL using the GET method. When received in response to a POST/ PUT/ DELETE, it should be assumed that the server has received the data and the redirect should be issued with a separate GET message.
  • 304 – Not Modified: This HTTP status code used for caching purposes. That means the resource has not been modified since last requested. Normally, when a document is cached, the date it was cached is stored. When the document is viewed next time, the client asks the server if the document has changed. If not, then the client just reloads the document from the cache.
  • 305 – Use Proxy: This HTTP status code indicates that the client’s requested resource can be reached through a proxy mentioned in the location header. The address of the proxy has to be provided in the response. Not all clients implement this because of security reasons.
  • 306 – Switch Proxy: This HTTP Status code indicates the subsequent requests should use the specified proxy. But it is no longer in use and is reserved for the future.
  • 307 – Temporary Redirect: Here the server sends the HTTP response to direct the client to get the requested resource at another URL with the same method that was used in the previous request.

4** Client Error: The HTTP status codes in this class indicate the errors that are technically the result of a problem with the client’s request.  

  • 400 – Bad Request: This error code indicates the HTTP request that was sent to the server has invalid syntax. 
    Steps to Troubleshoot: 
    • Check for errors in the URL (Uniform Resource Locator) which is the most common reason.
    • Cookies linked with that site may be corrupted so clear the cookies and cache of the browser.
    • Try to open the same webpage on separate web browser.
  • 401 – Unauthorized: This error code indicates that the user trying to access the resource without having proper authentication. So that the user must provide credentials to view the protected resources. 
    Steps to Troubleshoot: 
    • First check for the errors in the URL, if the URL is valid, then visit the main page and look for the link saying log in or secure access. Enter your credentials and then try again or if you don’t have valid credentials or forgot your password then follow the instructions to create a new account or reset your password.
    • Clearing browser cache can solve this error because there might be invalid login information stored locally in your browser i.e. interrupting the login process.
    • If the site shouldn’t need authorization, then this error message may be a mistake. Hence it is best to contact the website administrator.
  • 403 – Forbidden: It generally occurs when the user made a valid request but the server is refusing to serve due to lack of permission to access the requested resource. 
    Troubleshoot Steps for Client: 
    • Contact the ISP (Internet Service Provider), if the website is working for others.
    • In order to get permission, you must speak to the website administrator to grant access.
    • If the user keeps on getting this error, make sure www data contains proper permission to access file/read. Typically it means that the permission of the file should be set to read.
    • Check .htaccess settings (.htaccess file controls the access of resources, specific to a certain range of IP address).
    • It can also happen if your website doesn’t have an index file. If it is not, then you should rename your homepage as index.html / index.php.
  • 404 – Not Found: This error code indicates that the user can communicate with the server but the server is unable to locate the requested resource/file. 
    Steps to Troubleshoot: 
    • Check out the URL again if it contains any error.
    • Refresh your web page by pressing F5 key.
    • Clear your browser cache.
    • Modify the DNS (Domain Name System) server. (Try it only if, the entire site gives you a 404 error)

5** Server Error: The HTTP status codes in this class indicates the server is aware that it has encountered an error or is otherwise incapable of performing the request. 

  • 500 – Internal Server Error: It is the most common server error and is usually referred to as catch all code error. This HTTP error code indicates that there is something wrong with the website server and the server is unable to detect the exact problem. Although this is not a problem from the client side but the client can attempt to resolve it by following steps. 
    Troubleshoot steps for Client: 
    • May be there would be high web traffic. So by reloading the webpage by pressing F5 key can solve the issue.
    • Clear your cookies and cache of your web browser.
    • Check your website’s .htaccess file. Make sure that it is build properly.
    • Check if there is any incorrect permission on files and folders.
  • 502 – Bad Gateway: This HTTP error code indicates that the server is acting as a gateway or proxy server and unable to get a valid response from upstream servers or the origin server. This can occur because of the DNS issue. 
    Steps to Troubleshoot: 
    • Reload the URL by pressing F5 key.
    • Start a new browser session by closing all opened browser windows.
    • Clear browser cache.
    • Disable your CDN (Content Delivery Network) temporarily.
    • Restart your network devices. (modem, router etc.)
  • 503 – Service Unavailable: This error code indicates that the server is extra loaded or under maintenance and the service should become available at some point. 
    Steps to Troubleshoot: 
    • Reload the URL by pressing F5 key.
    • Restart your router, modem and your device.
  • 504 – Gateway Timeout: This error indicates that the server is a gateway or proxy server and is unable to get a response from the backend server within the allowed time period. 
    Steps to Troubleshoot: 
    • Try reloading the URL by pressing F5 key.
    • Restart all your network equipments such as: modem, router etc.
    • Check the proxy server settings in your browser or application and make sure they are correct.
    • Change the DNS server. (if all the devices in your network are getting the same error)
    • If still you are getting this error message code then contact the website administrator.
    • And if still also you are getting this error then contact to your ISP.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!