We all devote part of our daily lives to using the internet. Sometimes we use the internet to learn about a subject, do research on a product or buy a product. If we want to switch to another page after doing a search on Google or while browsing a website, we sometimes see that the page doesn't load. We see on the screen some three-digit error codes such as 404 and sometimes 500. Well, what do they mean? Actually, when we access the pages without any problems, there are still similar status codes in the background that we don't see. In this blog post, we discuss these status codes, namely HTTP status codes. I hope you enjoy reading it. :)
- What are HTTP Status Codes?
A two-sided interaction takes place when users want to visit a website. On one side of this interaction is the browser and on the other side is the server. This interaction starts with the user wanting to access a web page. When a user accesses a web page, the browser actually sends a request to the server in order to view the page. The server responds to this request with a three-digit status code. The three-digit responses the server gives to the browser are called HTTP status codes. Sometimes, these status codes might indicate that there is an error and other times they might indicate that the page has loaded without any problems. Therefore, it's not right to always assume HTTP status codes to be errors.
- Why Are HTTP Status Codes Important?
HTTP status codes are a very important element for both users and websites. When there is a problem with the web pages users want to access, they want to know the root cause. That's why HTTP status codes are very important for users. Likewise, websites whose pages won't load due to specific problem(s) can be affected negatively in terms of both user experience and SEO performance. Therefore, it is very important to know which response codes the server sends to the users in order to understand the root of the problem and resolve it.
- HTTP Status Codes Classes
1xx: informational status codes indicating that the server has received the browser's request and that the process has started.
2xx: status codes indicating that the server has received and understood the browser's request and that the request has succeeded.
3xx: status codes indicating that the requested resource has been moved to another location and will be redirected.
4xx: status codes indicating that the request cannot be fulfilled and that the requested web page or website is unavailable.
5xx: status codes indicating that the server has successfully received the browser's request, but that the request cannot be fulfilled due to problems on the server side.
- The Most Common Status Codes
Status codes that show up as a result of the interaction between the browser and the server vary in their meaning. Let's take a look at the most common status codes that have the most effect on websites together.
200 Status Code (OK)
In summary, this is the ideal status code. The server responds to the browser with a 200 status code if a web page loads smoothly. If the server responds to the browser with a 200 status code, we can say that everything is as it should be for the visitor and the website.
301 Status Code (Moved Permanently)
This is a status code that automatically redirects the visitor when a web page has been permanently moved to another web page. Power loss can be minimized if you redirect to web pages using a 301 status code and if those pages are quite similar in terms of content. It is therefore one of the most important status codes recommended for processes such as website migration.
302 Status Code (Found)
This status code indicates that a web page has been temporarily moved to another web page. It differs from the 301 status code in that it is used in certain cases where the requested page will be reactivated. Such cases might be that the web page is being tested, is in maintenance or that a specific product is temporarily out of stock, if it's an e-commerce website. However, the users won't be able to tell the difference between a 301 redirect and a 302 redirect. Users accessing the web page will be automatically directed to the other page.
403 Status Code (Forbidden)
This status code, which is in response to the user's request to the server, indicates that the user is not allowed to access the requested web page or that the web page is forbidden.
404 Status Code (Not Found)
This status code indicates that the requested web page cannot be found in the server. The web page might have been deleted or its URL changed. However, a 404 status code doesn't reveal whether this situation is temporary or permanent. When users encounter a 404 status code in a web page they requested, they tend to leave the website and go to different websites. This will affect the website negatively, especially if it receives a lot of traffic or its URL is well-known to users. Therefore, we recommend that web pages with a 404 status code be redirected to an equivalent page, if any. However, if the web page will be up again after a while, or if the product will be in stock again in an e-commerce website, it would be more appropriate for the page to remain with a 404 status code. If the page does remain with a 404 code, we should try and maintain its audience by directing them to other pages. So, with customized 404 pages, we can help users navigate to different pages instead of leaving the website.
410 Status Code (Gone)
This status code indicates that the web page the user wants to access is not available in the server. Unlike the 404 status code, it indicates the web page has been permanently deleted and will not come back. In addition, when search engine bots encounter web pages with 410 status codes, search engines can remove them from the index faster. This is why you need to be really careful about using this code.
500 Status Code (Internal Server Error)
This is the code you see in server-related problems. It means something is wrong with the server. For websites with 500 status codes, the server problem in question must be resolved as soon as possible. This is because search engines will not want to provide their users with websites that users or search engine bots cannot access.
503 Status Code (Service Unavailable)
This status code indicates a temporary problem on the server side. It is often seen when servers are in maintenance or temporarily down as a result of overloading. For example, people are unable to access the OSYM website when the university exam results are announced or another website when it has special offers. Also, the server will be temporarily down due to bandwidth attack by people with malicious intent and users will see a 503 status code when they want to access the website.
- Other HTTP Status Codes and What They Mean
Above we have looked at the status codes which were the most common and the most important for SEO. You can find down below the other status codes and their meanings you might come across, although rarely.
1xx Status Codes
100: means that the server has received the browser's request header and is ready to receive the request body.
101: means that the browser requested the server to change the protocol and the server has accepted the request.
103: means that it has returned some response headers before final request message.
2xx Status Codes
200: The ideal status code that means everything is fine on both the browser and the server side.
201: means that the server has fulfilled the request and that a new resource has been created.
202: means that the server has accepted and is processing the browser's request. The request might have positive or negative results.
203: means that the origin server has modified the response during the process despite having sent a 200 status code.
204: means that the server has successfully processed the request but will not return any content.
205: Just like the 204 status code, it means that the server has successfully processed the request but will not return any content. However, the browser needs to reset the document view.
206: The status code that allows the browser to resume interrupted downloads and split downloads into multiple parts.
3xx Status Codes
300: means that the server has more than one possible resource to fulfill the browser's request and must choose between those resources.
301: indicates that a web page or a resource has been permanently moved to a different resource.
302: indicates that a web page or a resource has been temporarily moved to a different resource.
303: means the browser requested a resource using POST, PUT or DELETE and the resource has been found. In order to retrieve the resource using GET, you have to make a request to a different URL.
304: tells the browser that the cached resources have not been modified.
307: indicates that a resource has been temporarily moved to a different resource. Unlike the 302 status code, it does not allow the HTTP method to be changed.
308: indicates that a web page or a resource has been permanently moved to a different resource. Unlike the 301 status code, it does not allow the HTTP method to be changed.
4xx Status Codes
400: indicates that the server cannot process the request due to an error in the browser.
401: is returned when the user does not have valid authentication credentials for the requested resource.
402: means that the resource requires payment and is reserved for future use.
403: is returned when it is forbidden to access the requested resource.
404:indicates that the requested resource cannot be found in the server. It is one of the most common HTTP status codes.
405: is returned when the request method used is not supported for the requested resource.
406: indicates that the criteria given in the Accept Header field of the client's request cannot be matched.
407: is returned in cases where authentication and authorization with a proxy server are required.
408: is encountered if the server times out while waiting for the request.
409: means that the request cannot be completed due to a conflict.
410: means that the requested resource is permanently unavailable in that server.
411: means that there is no specified length for the requested resource.
412: means that the server cannot meet the client's preconditions.
413: means that the request cannot be processed because it is too large, and that the server cannot accept the request.
414: is encountered when a GET request is encoded with a query string that is too long for the server to process.
415: means that the request contains a media type the server doesn't support.
416: is encountered if the server cannot supply the requested portion of the file.
417: is encountered if the server fails to meet the expectations in the Expect request header field.
422: means that the server cannot process requests that contain semantic errors.
425: is encountered when the server is not willing to risk processing requests that might be replayed.
426: is encountered in cases where the server requires a different protocol due to the content in the Upgrade request header field.
428: means that preconditions are required before the server processes the request.
429: means that the user has sent too many requests within a given amount of time based on the server's rate limiting settings.
431: means that the server cannot process the request because its header fields are too large.
5xx Status Codes
500: is encountered when the request cannot be fulfilled due to a problem in the server.
501: means that the server doesn't recognize the request method or is unable to support the functionality.
502: means that the server received an invalid response after sending a request to another server.
503: occurs in cases where the server is temporarily unable to process the requests.
504: occurs when a request times out while one server processes a request and waits for the other server's response in the meanwhile.
505: means that the HTTP protocol version that is used isn't supported.
511: occurs when authentication is required to gain network access before sending the request to the server.
- How Can You Check for HTTP Status Codes and Errors?
First of all, if you're wondering what status code any web page you visit loads from the server with, you can use browser plugins specially developed for this. Below you can see a sample image from the plugin named "Redirect Path". When we look at the image, we see that a sample page loads smoothly from the server with a 200 status code.
In another example below, we see that a web page is permanently redirected to another web page with a 301 code. When we examine the sample image from the plugin, we see that the top page is redirected to the bottom page with a 301 status code and that the redirected page loads smoothly with a 200 status code.
However, if you want to get general information about status codes on a website, you can get help from crawling tools such as Screaming Frog. These tools, which represent search engine bots, crawl all the pages of your website and give you detailed information about the web pages crawled.
In the following sample image from the Screaming Frog tool, you can see which status code all your pages contain from the main screen in the column “Status Code” after the crawling session. In addition, you can easily filter status codes from the section called “Response Codes” in the top menu and see which pages load with which status codes. You can also easily export the results to analyze them.
Finally, if you log in to your Google Search Console account and go to "Details" in the "Coverage" section, you can easily see your pages with error codes and the warnings provided.
- How Can You Fix HTTP Errors?
You can crawl your website with the methods above or you can check the important pages one by one with plugins. Then, depending on the size of your website or the technical problems, you can see that dozens or even hundreds of pages contain status codes that appear to be errors. These status codes that contain errors may have occurred for many different reasons. Therefore, you should investigate the causes of the errors, solve the root of the problems, and open the pages to users again. Otherwise, users will encounter different error codes on your website. And so, they will probably want to leave it and find what they are looking for on other websites. This will negatively affect the user experience and your performance on the search engine results pages.
- The Effect of HTTP Status Codes on SEO
Starting with the main directory, search engine bots crawl all sub-pages of a website. During this crawling session, they send -like a user- a request to the server for each page to be viewed. As a result of this request, search engine bots see the status code received from the server as well. After this crawling session, search engine bots determine which pages to index or which pages to remove from the index, taking into account the status codes received from the server. Websites with predominantly 200 status codes are not penalized by search engines because they successfully provide service to their users. However, if the website in question predominantly contains 4xx and 5xx status codes, based on the number of pages, this may lead search engine bots to evaluate that website as poor quality and penalize it. Because if websites cannot be viewed and crawled properly, search engines do not want to offer users such websites at the top. Therefore, status codes are quite an important factor for websites.