Introduction
Whenever you browse the web, your web browser is constantly interacting with web servers. This interaction takes place via HTTP, or Hypertext Transfer Protocol. Each time you request a web page from a server, the server responds, among other things, with an HTTP status code. The status code is the code so the browser knows the result of the request.
HTTP status codes are three-digit codes that a web server provides to a web browser, or another client, as a response. There are 5 categories of status codes, each with its meaning, and this can be helpful for troubleshooting issues with the website or for just using the website more effectively.
In this article, we’ll examine some of the most common HTTP status codes, their meaning, & how to respond to them.
What Are HTTP Status Codes? What do they mean?
HTTP status codes are standardized responses back to browsers from the web server about the status of your request. They signify what happened with the request from the browser’s perspective. HTTP status codes communicate to the user and search engines what the outcome was when you requested a page on the site.
There are five classes of HTTP status codes:
- 1xx: Informational responses
- 2xx: Successful responses
- 3xx: Redirection messages
- 4xx: Client error responses
- 5xx: Server error responses
Now, let’s discuss each of the above classes and relate some example codes to each.
1xx: Informational Responses
1xx codes are informational. They indicate to the browser that the server has received the request and is in the process of handling the issue. The first ones are not standard and you’ll likely never come across them in your role as an end user.
Common 1xx Status Codes:
- 100 Continue: Indicates the server has processed the request’s header and the client should proceed to sending the body of the request.
- 101 Switching Protocols: This indicates that the server has accepted the requested change in protocols as requested by the client.
2xx: Successful Responses
When you are talking about 2xx codes, you are indicated that the request was received and was successful. These are the “good” codes that you want to see.
Common 2xx Status Codes:
- 200 OK: This is the standard response for all HTTP requests that have been processed successfully.
- 201 Created: The request created has been satisfied thus creating a resource.
- 204 No Content: The state of the reckon is a success because the server has agreed to process the given request even though it is not fulfilling any content.
- 206 Partial Content: The server is a sender and is sending back only a part of the resource because the request made by the client included a range header.
3xx: Redirection Messages
3xx codes tell the browser that there is more for the browser to do in order to complete the request. More often than not it is because that specific page has been moved to a different URL.
Common 3xx Status Codes:
- 301 Moved Permanently: This unaffected message might simply state that the requested page has moved and is now permanently at another URL.
- 302 Found: This indicates that the requested page has been temporarily redirected to a different page.
- 304 Not Modified: This means the client has a cached edition of the requested page updated.
- 307 Temporary Redirect: This is just like 302 however, it tells the client to resend the same method they used from the previous request.
- 308 Permanent Redirect: This is just like 301, however it states that the client must use the same method as the last time, for additional information.
4xx: Client Error Responses
All of the 4xx codes mean that an error occurred with the request that was being made. Most commonly, it will mean that the page is not found, or the page cannot be seen by the individual visitor.
Common 4xx Status Codes:
- 400 Bad Request: The server couldn’t understand the request because of an invalid syntax.
- 401 Unauthorized: The request requires user authentication.
- 403 Forbidden: The client does not have access rights to the content.
- 404 Not Found: The requested resource could not be found on this server.
- 405 Method Not Allowed: Request was made to a resource which has a request method not supported by that resource.
- 406 Not Acceptable: It’s a client error response status code indicates that the server could not produce a response matching the list of acceptable values.
- 408 Request Timeout: The server timed out waiting for the request.
- 422 Unprocessable Entity: A client error that is returned by the server to indicate that it understands the content type, and the syntax is correct.
- 429 Too Many Requests: The user has sent too many requests in a given amount of time.
5xx: Server Error Responses
The 5xx series of codes indicates that an error occurred on the server side. These errors are typically not an error in relation to the user or the browser.
Common 5xx Status Codes:
- 500 Internal Server Error: A general simple workflow error message for when the server encounters an unexpected and or an issue/code condition.
- 501 Not Implemented: The server does not support the functionality that is needed to fulfill the request.
- 502 Bad Gateway: The server received a response from an upstream server which is considered an invalid response.
- 503 Service Unavailable: The server is currently not able to handle the request; typically because it is down for maintenance or overloaded now.
- 504 Gateway Timeout: The server did not receive a timely response from an upstream server or application.
Where and How to Check HTTP Status Codes?
There are many ways to check HTTP status codes:
Browser Developer Tools:
Opera, Firefox, Chrome, and most up to date browsers have tools called a Developer’s tools. You can do this by either using F12, or right clicking any space to view the options to accomplish this, such as “inspect“.
From within the Developer Tools, navigate to the “Network” tab and you will see the status codes presented for every request submitted.
Online HTTP Status Code Checker:
Similar website like ‘HTTP Status Code Checker‘allows you to enter a URL and provides you with the status code it will return.
Command Line:
In Windows, you want to utilize the logical “curl” command which is built into PowerShell.
In Mac or Linux you can implement the so-called “curl” via the terminal of your computer.
Common HTTP Status Code Issues and Solutions
Below are some common HTTP status codes that you will run into and some solutions to resolve them:
404 Not Found:
- Look at the URL for mistakes.
- If you clicked on a link inform the owner of that link that it is broken.
- Use the site’s search feature or sitemap to locate the material.
403 Forbidden:
- Determine whether you need to log in to access that content.
- Make sure you have the privilege to access.
- Contact the website administrator if you think you should have access.
500 Internal Server Error:
- Refresh the page.
- Clear your browser’s cache and cookies.
- Wait and try again, it is often a temporary issue.
503 Service Unavailable:
- Wait and try again it is very likely the server is down for maintenance or overloaded.
- Check the website’s social media for any notice of downtime.
HTTP Status Codes and SEO
Search Engine Optimization (SEO) encompasses HTTP status codes as well as other components.
Here’s how many of those codes could impact your SEO.
- 200 OK: This is what you want for your important pages. It simply tells the search engines that the page is out there, and it’s open for business, so to speak.
- 301 Moved Permanently: Use this in cases that you have moved a page semi-permanently, for a term or indefinitely. It passes almost the whole SEO value along to the new URL.
- 302 Found: This is efficiency when the move is temporary. It does not pass SEO value, so do not use for permanent direction.
- 404 Not Found: While not necessarily a dangerous error, it will frustrate users and potentially waste crawl budgets.
- 410 Gone: You want to specifically use this for pages you have eliminated and will not revive. It helps the indexing process for search engines because it decreases the number of pages indexed.
- 500 Internal Server Error: These errors can not only annoy your users, but also impact ability to crawl your pages. Resolve these errors as soon as possible.
Professional Approach towards HTTP Status Codes
To keep your website working efficiently and SEO friendly, you should follow these steps:
- Use the Appropriate Status Codes: The response of the server should reflect the situation and use the codes listed above.
- Put in Place the Correct Redirects: Always use 301 for permanent redirects and 302 for temporary redirects.
- Make the Error Pages Custom: Consider a nice design for the 404 and 500 errors instead of the default ones; a better user experience.
- Check your Status Codes Regularly: It should be a habit to check your website for errors with tools such as Google Search Console.
- React Quickly when there is an Issue: Also fix the regular issues that can come up such as the 4xx and 5xx errors in a timely fashion.
- Have Page Speed in Mind: It is understood that slow page load times can lead to a 408 Request Timeout. Do not allow this to happen and manage the performance of your website.
- Use Proper Caching: Use the effective 304 Not Modified response for one way of fixing high server load and high load time.
Response Codes in API Design
For designing or using APIs in your solutions, an understanding of HTTP status codes is essential. Here are some best practices:
- Use Standard Codes: It is best to use those status codes that are standard and recognized everywhere for compatibility.
- Be Specific: Always use the most specific status code related to that specific circumstance.
- Provide Additional Information: Data, in the case of an error in the 4xx and 5xx range, should have a descriptive error in the response body.
- Implementing 202 Accepted for Asynchronous Operation: This means the request that was made was valid, but processing of the request will be completed at a later time.
- Implement Rate Limiting: Sometimes you may need to lock your API to prevent abusive traffic from using all of your bandwidth and server space. In that case, use 429 Too Many Requests.
Final Words
There are specific HTTP status codes that explain the results of a request to a web server regarding a specific web page when accessing the internet. They convey information that is informative for the user or other developers as well as search engines.
Once you are familiar with the codes, you can address them readily, optimize your site, and improve the overall usability for your users.
Are you interested in learning more about security and performance elements of the web? Take a look at CheapSSLWEB’s Blog to learn more about SSL certificates, HTTPS browser adoption, and tall orders with securing web development.
Our experts are passing on information regularly to help keep you and your site’s security running well. Don’t lose your opportunity to learn all about the new Web security tips and trends.
Frequently Asked Questions
What are the Most Popular HTTP Status Codes?
The most popular HTTP status codes are HTTP 200 (success), HTTP 301 (moved permanently), HTTP 404 (page not found), and HTTP 500 (server error). Each status code has more information in the reply from a server to a browser request for a particular website.
For example, an http status code 200 indicates ‘OK,’ meaning the request was successful, while http status code 404 indicates ‘not found,’ meaning that the requested resource was not found.
How are HTTP Status Codes significant to SEO?
It has been reported before that the role of HTTP status codes is very important in overall SEO.
For example, 200 is good for indexing all valuable pages and 301 (Permanent Redirect) passes value to the new URLs. However, too many 404 Not Found errors will decreased the crawling doe, and the user will not find what they were looking for wherever and however they searched for it.
Using the correct status codes is also important to ensure that specific search engines can understand the website structure and that the content was available to be crawled.
What is the Difference between 4xx and 5xx Codes?
4xx status codes (like 404 or 403) correspond to a client error, which means the site was found on the website, but there was an issue with the request or with the user’s permission.
5xx status codes (like 500 and 503) refer to the server. 5xx error codes indicate an error with the website server or application, which is a good thing to know when troubleshooting.
What are the Ways to Check Response Codes for my Website?
There are approaches you could take to check on the HTTP status codes: it can be checked easily on any website in the elements tab of the developer tools of your browser (commonly opened with F12), the HTTP status checker (online), curl (for command line), and so forth.
It is best to periodically check on your site’s status codes, as knowing your website’s status codes are important, and this allows you to catch problems in a timely manner.
What if my website is displaying a 500 Internal Server Error after I visit it?
If you see the 500 Internal Server Error message on the website that you are visiting, try to refresh the page (it could be a one-time error) first then if that does not help attempt to identify the individual error in the logs that the server writes, review the recent updates to the website, and evaluate the server resources to understand the potential cause of the error.
If these steps do not help you resolve the problem then reach out to your hosting services or website developer for assistance.