Skip to main content

Http Status Codes

A status code is a part of the solution returned by the server when a client (for example, a browser) calls a URL. With the help of a status code, the server indicates to the client whether the request has been processed successfully or if an error has occurred.

600x400-EN-StatusCodesHttp-01.png

Status classes

Three-digit HTTP status codes can be categorized into different status classes, represented by the first digit.

  • HTTP status codes of the first class represent information for processing and are sent during the request, they include status code 100 and status code 102.
  • The HTTP status codes of the second class represent a successful operation. One of the most common HTTP status codes that begins with a 2 is the 200 OK status code.
  • A third-class status code represents a redirect and is returned if the requested document is now available at a different address. Therefore, the treatment is not over yet and requires further action on the part of the client. Some of the most important status codes in this class regarding SEO are status code 3011 and status code 302.
  • HTTP status codes of the fourth class represent client errors, that is, errors that result from a faulty request on your part. A good example of this class is the 404 not found status code.
  • The fifth class contains server errors. These are errors that are attributed to the server. Status code 500 Internal server error and status code 503 Service not available are good examples of this class.
  • The ninth class of status covers both standardized status codes and property codes that can occur under certain circumstances. Here, the error is attributed to the network, and the client must resend the request. * The most common in this class are status code 906 and status code 950.

Check Http status codes

Normally, the web browser does not display the status code. Therefore, special tools must be used to monitor it. Browser extensions are a good way to monitor HTTP status codes like Live Http-Headers or special online tools like Web-Sniffer.

Status code 1xx - information

Status code 100

Status code 100 is returned if the server has successfully received a request and is waiting for further instructions from the customer. Only then can the request be executed by the server.

Status code 102

This processing status code is used to avoid a waiting time during the request. This can especially happen if the server has to process a request that takes a long time.

Status code 2xx - successful operation

Status code 200

The server returns status code 200 if the data requested by the client (for example, the web browser) have been transmitted in the desired way. In this circumstance, the following requirements should normally be met:

  • The server must accept the client's request, and
  • the requested resource must exist on the server.
  • At the same time, the server must be able to send the resource to the client.

If these requirements are met, the requested data is sent to the customer and the 200 OK status code is included in the solution.

Status code 200 is one of the most common status codes, since represents the normal case. The status code is returned when there are no problems.

3xx status code - redirect

Status code 301

Status code 301 shows that the resource requested by the client is no longer enabled at the given address, but has been permanently moved to another address (redirect). The old address of the resource is no longer valid. The new address is returned to the requesting customer, allowing you to retrieve the resource at the new address.

The difference between status code 301 and status code 302 (very equivalent), is found in the time designation. While the old address is still valid if the 302 status code is returned, the old address is no longer valid if the 301 status code is returned. Thus, the 301 redirects if it inherits the juice binding, whereas with the 302 do not.

Case - URL change

In the best of cases, the structure of a URL assigned once, remains permanently unchanged. However, if you need to change the URL structure of a page or change its domain, you must ensure that all old URLs are redirected to the new URL. This is especially true for URLs that have acquired valuable external links over time. How do you do it? Using a 301 redirect. In this circumstance, if the URL that no longer exists is called, the server returns the 301 status code and informs the client of the new URL for the resource. According to the RFC (Request For Comments) standard, an absolute URL must be used in a redirect. Therefore, Relative redirects are invalid.

Using 301

There are different ways to send the 301 status code. For example, when using PHP-based apps, a respective header can be generated. To do this, the following PHP code must be added to the old file:


However, it is much more practical to send the 301 status code using the .htaccess file. This requires a Linux server with an Apache moderation and rewrite module enabled. The following lines should be added in the .htaccess file:

Options + FollowSymlinks RewriteEngine on rewritecond % {http_host} ^ domain.com [nc] rewriterule ^ (. *) $ http://www.domain.com/$1 [r = 301, nc]

When using the 301 status code, you must ensure that all pages are redirected 1: 1 to new subpages and not to the main page in case of domain change. At the same time, so-called routing loops or long routing chains should be avoided. Googlebot is usually deactivated after the fourth or fifth redirect.

Link redirection
A 301 redirects most of the juice link to the new destination, but not the fame of the page in the Google Plus search engine. Before moving the content, you should check if the redirection is simply desirable.

Status code 302

Status code 302 “Found” displays a temporary redirect. This means that the requested resource may temporarily be at another address. At the same time as this status code, the server also returns the new address of the resource. An important difference from the 301 status code is that the original address is still valid. This is also the reason why content that is permanently accessible at a new address must be delivered with the 301 status code and not with the 302 status code. This is because Googlebot keeps searching and indexing the original location during the temporary redirect. Also, it is essential to ensure that no juice binding is inherited with status code 302, but rather with status code 301.

Status code 400 | Status code 4xx - client error

Status code 404

The 404 “Not Found” status code is always returned when the requested resource (mainly a URL, but it can also be an image or another file) does not exist or has ceased to exist, and it is, along with the 200 "OK" and 304 "Not Modified" status codes, one of the most common HTTP status codes.

Reasons for status code 404

A non-existent resource can arise if:

  • The resource has been moved to a different location, but not all internal links have been modified accordingly.
  • The resource was moved to a different location, plus there were external references to the document at the same time as the internal links. However, they were not informed of the move and thus remain linked to the old address. These are commonly known as "dead links".
  • The customer has requested a resource that never existed, for example by modifying or manipulating an existing and valid URL in the browser's address bar. This usually happens with copied links.

Rectifying the 404 error

You should always make sure that the number of 404 errors is maintained lowest viable. This is because neither users nor Googlebot are happy when they encounter an error page. You can use the Google Search Console under "Status -> Crawl error" to regularly view the pages found by Google with the 404 status code. All the information about the internal and external links of the URL can also be viewed here. This allows linked 404 pages to be detected and modified.

Status code 404

Soft 404 errors are found on websites that they no longer provide the requested content or return the 404 or 410 status code. In these cases, the webmaster has not provided a 404 error page, so the status codes "200 Ok" or "302 Found" are issued when the pages are visited.

In practice, it doesn't make sense for users to search for specific content, but they are shown a page that shows no error code, and instead shows content that doesn't match the query. Google recommends using the 404 status code when content is no longer hosted on a page.[1] For better usability, the error page can be optimized to persuade users to stay on the web portal.

Common SEO tools, Google Search Console, or Bing Webmaster tools can be used to review soft 404 errors.

Status code 5xx - server error

Status code 500

Status code 500 shows internal server errors. Therefore, the requested resource cannot be transmitted due to a server error. Since this is simply a "generic HTTP status code" for all possible unexpected server errors, it is not as descriptive. However, the 500 status code is returned in most cases when there are incorrect entries in the .htaccess file.

Status code 503

Status code 503 shows a temporary unavailability of the server. This can be the result of a number of reasons. For example, this status code can appear throughout server maintenance or overload. A "retry later" header field can be added to inform the client of the respective time that the submitted request can be processed. It should be noted that with status code 503, the server does not process the request even after the respective capabilities are available again.

Status code 9xx - owner status codes

Status code 906

This status code is provided if a error during transmission of client request to remote server. The request must be resubmitted.

Status code 950

Status code 950 is returned if an error occurs in the interpretation of an administrative request from the client. Here also, the application must be submitted again in most cases.

Importance of Status Codes for Search Engine Optimization

The http status codes play a important role in search engine optimization. A high frequency of 404 errors can indicate poor maintenance of the web page. If users receive the 404 status code when accessing URLs, this leads to a higher bounce rate, which in turn represents a negative user signal for Google and other search engines.

The indication "404-not found" or "404-not found" is a natural part of the web, if a page is no longer enabled, for example due to a domain transfer. Soft 404 errors, on the other hand, have a greater effect on search engine optimization. You deliver a status code that does not match the content of the page. In the worst case, Soft 404 errors can lead to the exclusion of a URL from the Google index.

In addition, 301 redirects are important for SEO, since they help avoid duplication of content.

References

Web Links