HTTP status codes: checking server responses and eliminating errors

In the article:

  1. How to check the server response code
  2. Server response code values
  3. Information codes
  4. Codes for successful request processing
  5. Redirect codes
  6. Client error codes
  7. Server error codes

Every time you contact the server, you receive a response status code from it. The codes are associated with the functionality of the site pages and signal the state of the page. Thanks to the meaning that the code carries, the server adjusts the processing of the document after the user's request. The most popular codes are 200, which indicates that the request was successful, and 404, which indicates an error if the resource was not found.

Search bots and browsers pay attention to the server response code.

What are the types of http responses from a server (site, page)?

HTTP server response codes (English HTTP status code) are part of the first line of the server response. It is a three-digit integer number, the first digit of which indicates the class of the condition. Along with the response code, a short English-language hint is given. Promoting websites on the Internet is impossible without knowing the server's responses.

Example:

404 Not found

Further actions depend exactly on what response code the server or page gave. Due to the fact that the set of codes is standard for all sites/pages/servers, the actions when issuing a particular code will also be standard.

Today there are 5 main classes of response code:

1xx: Informational (Russian Informational) - the request was correctly received, but its processing was not completed.

2xx: Success (Russian: Successfully) - the request was correctly received and successfully processed.

3xx: Redirection (Russian: Redirection) - redirection codes to other pages.

4xx: Client Error (Russian: Client error) - error on the client side.

5xx: Server Error (Russian: Server error) - error on the server side.

Now let's look at some of the IANA status codes individually.

A little theory

Analyzing the HTTP status code will help determine the availability of a web page. Technically, it is a standard request. It is sent when we follow a specific link on a website or simply enter it in the search bar of the browser. When processing a request, the server independently generates and sends a three-digit digital code.

Thanks to the response code, not only the search crawler, but also an ordinary user can understand the site’s reaction to a request. There is nothing complicated here even for novice webmasters.

First, let's define the terms.

  • Client – ​​a computer, smartphone or other mobile device that has an Internet connection.
  • Server is a specific computer that stores all site data (including pages and system files). It is on the server that the site “lives”.

There are five classes of responses. The class can be identified by the first digit.

  • 5** – technical error on the server side. The exact reason is indicated immediately after the code. Sometimes the 500th indicates internal failures, less often it indicates that the static load on the server has been exceeded.
  • 4** – failure on the user side.
  • 3** – a redirect to another address was detected (not an error).
  • 2** – the request was processed successfully (not an error).
  • 1** – a service class of codes, which most often refers to information messages (not an error).

The logic of the codes is thus very simple:

Server response 1XX

100 Continue Server Code

100 Continue reports that communication with the server has already been established, the server has accepted the correct request, and data is now being exchanged between the server and the client. This code is temporary, i.e. he is always followed by another. Code 100 is internal and is not an error code. Those. “The door is open, read what you need, when you finish, close it.” Code 100 may not be generated if the user has already received part of the data from the server.

101 Switching Protocols

This code is also not erroneous. Generated when switching from one protocol to another. For example, when requesting to switch from an older version of HTTP to a newer one.

This is one of the simplest server codes. It means that a request was received from the user to switch the type of protocol used on the web server, and the server agreed to this.

102 Processing

In a sense, this is an analogue of code 100. It is generated when processing a request may take a long time. For these purposes, the wait timer is reset and waiting for further commands occurs as usual. It is also not an error code.

Client error codes

Response codes in this group mean errors caused by the client or the inability to produce a result because there is no data on the page.

400 Bad Request

The request is incorrect, there is a syntax error somewhere in it, so the server cannot produce a result. To successfully execute a request, you need to correct the syntax; clearing cookies or page cache or correcting the request by the user usually helps.

401 Unauthorized

Information is available only to registered users or is password protected. If the user is not logged in, access to the page is impossible.

403 Forbidden

The request was successfully received and correctly formulated, but the server does not have access to the requested page. Access may be restricted specifically for certain IP addresses using a .htaccess file.

If the user www-data under which the server is running is denied access to reading the file, the command sudo chmod o=r /usr/share/nginx/html/index.html will help

Another reason is that the user accessed a closed directory that does not have an index file. Permission to browse the directory is enabled in the server settings.

404 Not Found

The server was unable to find the resource the user requested; the document does not exist at this address.

This is a common error, it may be due to the fact that the user made a mistake in the page address, the user does not have rights to read and execute the file, the file on the server was moved or deleted, the root directory was specified with an error, or the server is not configured to work with character “soft” » links used for processing.


Response code 404 Not Found

Links to remote sections of the site will return code 404. There is no need to spend a crawling budget on such documents, so the robots.txt file prohibits the robot from visiting and indexing such pages.

405 Method Not Allowed

The method used to make the request is not available. The server issues this code for specific individual objects on the page. For example, the query string that runs the script is different from the query the user makes.

406 Not Acceptable

The response code means that the requested file exists, the request is formulated correctly, but the encoding of the document is not available for decryption by the robot.

407 Proxy Authentication Required

This code is similar to 401 and 407 and is used if the question is valid but the client can only access the document using proxy authorization. The client is authorized if the proxy returns a field with the proxy-authenticate header.

408 Request Timeout

The server returns this response code if the client has not made any requests within the specified timeout. Code 408 is not returned if the user cancels the request, or the connection is lost and there is no way to send a response.

409 Conflict

The code means that there is a conflict in the system: for example, the user uploads a file to a server that already has such a file in a new version.

410 Gone

The response code is similar to a 404 code and means that the document to which the request was sent is no longer available. If the server returns a 404 code, the robot will return to the page to check its status, and if the response is 410, the robot will understand that the page has been deleted forever.

411 Length Required

The server cannot accept and process a request if the content-length header does not specify the length of the content.

413 Request Entity Too Large

If there is too much information in the request body and the server cannot process such a large request, then it returns error code 413. If this is a temporary problem, the server will indicate the time to wait in the Retry-After field.

414 Request-URL Too Long

Similar to the 413 code, except that the 414 code is displayed if the URL in the request is too long.

422 Unprocessable Entity

The server returns this code if it has accepted and recognized the request, but there is a logical error in the request body that prevents it from being executed.

424 Failed Dependency

If the execution of this operation depends on the outcome of other operations associated with it, the server will return this request.

429 Too Many Requests

Code 429 means that the user is sending too many requests in a short period of time, and the server cannot process that many.

431 Request Header Fields Too Large

If the request contains too large header fields, the server will not be able to handle the request and will return error code 431.

451 Unavailable For Legal Reasons

The code displays the same thing as 403, but with qualifications. It is used if access to the server is blocked by a court order, usually due to copyright infringement, or if access is blocked at the government level.

418 I'm a teapot

This funny code that returns the "I'm a teapot" error is related to the Hyper Text Coffee Pot Control Protocol. The error means that the request is incorrect and the kettle cannot be used to make coffee. The protocol and code for this error were created as a joke in 1998 for April 1st.

Code 418 I'm a teapot

Server response 404

That's it, the only people who didn't see the 404 server response error were those who weren't born yet and those who died before the creation of the Internet. This code indicates that the requested document is not available on the site for some reason. The server response error code 404 should only be returned if there has never been a document at the user-specified address. If a document was previously available at this address, and then it was removed from the site, then the server should return a code 410, not 404.

Fake 404 pages

Most webmasters do not pay any attention to 404 pages, however, this can seriously harm the ranking of the site. It’s a paradox, but a page with the message 404 File Not Found does not always return a 404 code. Such pages are usually called “Soft 404”. The reasons for this are simple - for some reason the page returns a code other than 404 and 410 - for example, 200. This is quite possible if the page has already been created, but there is no content on it yet.

What do HTTP status codes mean?

I will give reasons/solutions/explanations of errors only for the most common codes. For everyone else, just a brief description.

What site checks should be done monthly: prevention and error diagnosis

Two hundredths – successful requests

200 – successful data request. The code is not an error.

201 – successful transaction completed . The code indicates that a new resource (or document) has been generated.

202 – the request has been accepted, but has not yet been completed . You must wait until processing is completed.

203 – the data was not received from the original source (the returned data does not come from the original server, but from some other server) and may be out of date.

204 – the request was processed correctly , but there is no content. There is a response header, but no content for it. There is no need to update or update the content.

205 – the client needs to reset the content. The page itself does not need to be updated.

206 – partial content error. If the client wants to load data into multiple threads and the server only executes part of the GET request, a 206 error will occur.

A GET request is for receiving data, while a POST request is for sending data.

Code can also be sent from the server when the client has requested a range (eg conditionally: "Give me the first 2 MB of video data"). Only partial content corresponding to the Range header is returned (this header makes it clear to the server what part of the page is required from it and which it needs to return).

If the page returns this code, you should pay attention to the caching and the outgoing request.

207 – several operations performed. You can find them in XML, in the MultiStatus line.

IM header processed The content will be returned for response information along with the previously designated parameters.

Top 64 Google Ranking Factors Relevant in 2021

Three hundredths – redirect requests

300 – The exact URL could not be identified . This response occurs when there is multiple selection and the crawler does not know which page the resource belongs to.

301 – The document has been permanently moved to a new URL . All web pages that are deleted or are mirrors or duplicates should respond this way. Over time, all specified pages will be merged with the target web page (attached to it) automatically. If this error occurs, you need to set up a 301 redirect from the outdated URL to the current one (if we are talking about a web page that was already ranked, but its URL has changed). In this case, all positive metrics, including URL weight, will be preserved.

302 – the document has been temporarily moved to a new URL . This is an absolutely correct response from the server, which is relevant for web pages with sales or seasonal promotions that apply to any product. The code indicates that this URI will be respected by the client in subsequent requests. In other words, the page was found but moved. Such documents are not removed from the index. If the address has been permanently changed, it is better to use a 303 or 307 response instead of a 302.

303 – you need to redirect the user to a different URL . The 303 code can only be obtained with a GET request. Ideally, this code should be given when you need to redirect the visitor to a closely relevant, but not identical page.

304 – the document has not been modified. This code is not a standard redirect. It helps crawlers identify pages that have not changed since the last visit.

If your site has few pages (up to 1,000), there is no point in using the 304 code. If this redirect bothers you, then in the header you need to correct the Last-Modified parameter (last date of modification) - it should not be older than the If-Modified-Since header (if it was changed after a specified amount of time).

305 – this document can only be accessed through a proxy .

307 – the document has been temporarily moved to a different URL. An ideal option if you need to temporarily redirect a visitor, but leave the technical ability to send POST requests.

Server response 500

All 5xx series codes indicate that the server is unable to complete processing of the request. Along with the code, an explanatory hint (with a reason) should appear in English.

500 Internal Server Error

Code 500 is given in case of any internal server error, with the exception of other errors of class 5xx. Such an error can be given when the link is generated on the server immediately at the time of the request. The simplest example is an internal search on a site: there is physically no document at the requested link.

What causes HTTP 302 error?

Here are some of the most common reasons for the 302 redirect error:

  • Using 302 redirects when moving a domain;
  • Create a 302 redirect when moving a document;
  • Using a 302 redirect during a site protocol change;
  • Creating 302 redirects when changing the site structure.

An HTML 302 redirect is not recommended when the source request method must be applied to the target URL request - for example, moving the URL of a form directive that uses the POST method for a specific period. You shouldn't use a 302 status code if you want to transfer SEO weight to the target URL.

Server response 550

If error 550 occurs, you need to check how correctly the MX records are written in order to eliminate these server response errors.

To check, you need to follow the link (https://www.reg.ru/nettools/dig), then enter the name of the domain being checked, and select “MX” in the list. Now click Check:

The output will be a table.

You need to make sure that it contains the necessary entries for your mail to work:

Mail MX records
REG.RU mail on hosting mx1.hosting.reg.ru and mx2.hosting.reg.ru
Yandex mx.yandex.net
Google Apps aspmx.l.google.com …
Mail.Ru for business emx.mail.ru
Advanced anti-spam protection mxs1.reg.ru and mxs2.reg.ru
REG.RU Mail on VPS mail.domain.ru

IMPORTANT! Mixing MX records is not allowed, i.e. the table in the output should only contain those MX records that are needed specifically for your mail. If necessary, you need to adjust the records by correcting errors and/or removing unnecessary items.

HTTP 302 redirect example

The most common HTTP 302 redirect example case is Google. Regardless of the country you are in, if you enter https://www.google.com/, you will be redirected to the Google version in the language/country that corresponds to you.


In the case of Germany, 302 will automatically take us to https://www.google.de/ so that we can search for content in German. Portals of successful companies such as Coca-Cola or even Fujitsu also use this system to redirect traffic to where they find it most convenient.

How to get server (page) response codes via Yandex

Step 1. Check the server response code to the site page that should be in the search.

Open any page of your site that is in the Yandex search results, then copy its URL from the address bar.

Now we go to the Yandex service (https://webmaster.yandex.ru/server-response.xml), with which you can look at the site through the eyes of a robot and check the server response speed in the Yandex panel.

Simply paste the URL of the page we are interested in into the text field and click on the “Check” button. In this case, we received a 200 OK code, indicating that the page is working normally.

Step 2. Check the server’s response to a obviously non-existent page.

In the same service, enter domain_name/some_crocozyabr

In this case, we received a 301 Moved Permanently response. This indicates that the page address is incorrect and the page is being redirected to the correct address.

Redirect codes

The class of codes shows that in order to successfully complete a request, the client needs to make a transition, that is, a redirect.

300 Multiple Choices

The robot cannot index the page because it cannot match the resource and the URL. A common reason is that the resource has been moved to another address. The server offers the client a choice of alternatives to navigate to. For successful indexing you need to either specify the resource correctly or correct the headers.

301 Moved Permanently

If the address of an indexed page has changed, then a 301 redirect is configured from the old URL to the new one. The response code indicates that the requested document has been permanently moved to another URL where the link redirects the user. The robot will index the page to which the redirect leads and merge the original address and the new one.

302 Found

The code does not mean permanent, but temporary movement of the page to another address, so there is no need to remove the page from the index. The response indicates the new data location.

The page remains in the index, and the link juice continues to be transferred.

303 See Other

The server signals that the resource specified in the request is located at a different address. Typically it is used to redirect the user to the selected resource by outputting data from a POST-activated script.

The server response will indicate the address where you need to look for a result that satisfies the request.

304 Not Modified

It is recommended to issue the code if the page has not changed since the robot last visited it. The server signals this to the bot, the bot receives http headers from the document without reloading the page, which makes indexing faster and reduces the load on the server.

305 Use Proxy

The response code is related to data security. The server issues a 305 code if the resource the client is requesting can only be accessed through a proxy. The proxy is indicated there in the server response.

307 Temporary Redirect

Code 307 is similar to 302, but provides a more specific response. The code means that the resource required by the client has been temporarily transferred to another address, and the new URL must be entered in the Location.

How else can I find out the server (site) response codes?

Mainspy

As an alternative, you can punch the response code using the https://mainspy.ru service. It works similarly to the Yandex service: insert the URL of interest and click “Check”. The response code in this case is in the very first line:

Bertal

Bertal, unlike Mainspy, allows you to look at the page not only through the eyes of a Yandex bot, but also through the eyes of Bing and Google search robots, and as a bonus, it can emulate popular browsers. For convenience, let's look at the same pages through the eyes of GoogleBot. In this case, the response code is highlighted in green.

HTTP Error 404 "Not Found"

The server could not find the requested page, file, or other resource. An HTTP 404 error indicates that the network connection between the client and server was successful. Occurs when the user entered an incorrect URI in the browser, or the server administrator deleted the file without setting up a redirect to the new location. To resolve this issue, users must type the correct URL.

Bulk checking of server (site) responses online

Mass checking of response codes can be useful for finding broken sites on which links were purchased (through exchanges or directly, it doesn’t matter).

Dimax.biz - https://backlinks-checker.dimax.biz/tools/proverka_otveta_servera.php - this is one of the best checkers. The only negative is that in the free mode you can make no more than 2 requests of 50 links each. For more “serious” volumes you will have to use a paid PRO tariff. At the output we get a list sorted by response code. In this case, there is no need for sorting, because There are only 2 addresses in the list, and both give code 200.

Urlitor

Urlitor is another service for mass verification of response codes. The good thing about the service is that the test results are tabulated to make it easier to understand. By the way, the links in the table are clickable.

HTTP 502 "Invalid Gateway"

An error occurring in the network between the client and server causes this HTTP error code to be output. This may be due to configuration errors in your network firewall, router, or other network gateway.

Let me know what you think about this topic of material in the comments. Thank you so much for your comments, responses, dislikes, subscriptions, likes!

Let me know what you think about this topic of material in the comments. Thank you so much for your comments, responses, subscriptions, likes, dislikes!

Vadim Dvornikov, author and translator of the article “HTTP Error and Status Codes Explained”

How to check the speed (time) of the site server response?

It’s impossible to count how many such services have already been created. Let's look at some of them.

Pingdom

This is an English-language tool that analyzes speed in all parameters. With its help, you can find out the speed in seconds, how much the tested page weighs, and also get an assessment and recommendations for improving it. The advantage of this service is that each individual element is analyzed. This analysis allows you to find out what exactly is slowing down the loading of a particular page and/or the site as a whole.

Which Loads Faster

The main feature of this service is that it analyzes the loading time of two resources simultaneously. This allows you to find out which of the two resources is faster. The only negative is that the results may differ on different connections and in different browsers.

Google PageSpeed ​​Insights

Google PageSpeed ​​Insights is also one of the most powerful tools for measuring the speed of mobile and desktop versions. The assessment is made on a 100-point scale. 85 points or more is a good indicator. Plus, as a bonus, it gives recommendations for improvement.

Long server response

A response that lasts more than half a second is usually called “long.” Therefore, when loading the site for a long time, you may see a message in the browser “the timeout for a response from the server has been exceeded.” There can be many reasons for a long response:

— complex logic for providing data

— the server does not have time to process incoming requests in a timely manner due to their large number

— the queries themselves (either complex, or unoptimized, or both)

— requests to a large number of external resources

- a large number of executable files

— the web server itself takes a long time to process the request.

The most painful areas of server performance:

Web server used (Apache, IIS).

A number of web servers can create delays even when serving static files, because... At the architectural level, they are not designed to process a large number of requests and because of this, there may be a message that the timeout for a response from the server has been exceeded. Therefore, for the normal operation of the web server, it makes sense to use nginx (and in conjunction with Apache, php-fpm, as well as other application servers for processing server-side calculations).

Using OpCache.

Reduce server response time by caching executable code (site scripts) - it allows you to use a ready-made result instead of translating PHP instructions into binary code each time. But this caching has nothing in common with caching the results of executing PHP scripts.

Database queries.

The second step to server performance is setting up tables (indexes) in the database and structuring them to facilitate query processing. This also includes recalculating intermediate results and caching the most frequently used results into separate tables. This will reduce the consumption of server resources several times and help reduce server response time.

Complex data processing logic.

The third step is to simplify the server logic. Essentially, it's just eliminating unnecessary operations and profiling the execution time of server-side scripts.

Access to third party services.

Requests to third-party services written in the code of server scripts are a “common story” that can bring many surprises, since the performance of the services from which data is requested is almost never checked by anyone. But the response time of a third-party service directly affects the server’s response time. Therefore, it is best to use only internal sources in server queries, which can be monitored for performance quality at any time, or request data from the client in a deferred mode.

Why web server response speed affects promotion.

Firstly, because loading speed is one of the ranking factors (although not decisive). Google openly states that less than 1% of sites rank for page speed. BUT…

Secondly, if the page takes too long to load, the user will simply close it. This user behavior is usually called “refusal”. By the way, “refuses” have a direct impact on positions in search results. The higher the loading speed, the lower the bounce rate and, as a result, the higher the rankings.

Timed out waiting for a response from the server.

First, it is important to understand the cause of the failure. Those. the user enters the address, and the browser at this moment sends a group of requests, and also starts a countdown stopwatch for each of them. If after a specified time the browser does not receive a response to its request, then the user will see such an unpleasant picture.

There can be several main reasons for the failure:

  • It is impossible to connect to the site due to unstable operation of its servers;
  • Broken browser settings or clutter;
  • Problems with the Internet connection on the user's side;
  • The resource is blocked.

What to do to solve?

If the failure is isolated, reload the page using the Ctrl+F5 combination. You may need to reload the page several times. If it doesn’t help, check your Internet connection.

Network Settings.

1. Some sites are sometimes capricious. For dynamic IP, the solution is simple - reboot the router by turning off the power.

2. A slow connection sometimes causes the ERR_CONNECTION_TIMED_OUT error. Internet speed can be checked using the Yandex Internet meter. If the speed is too low, you should contact your Internet provider.

3. You need to check “Network Properties” for the presence of extraneous DNS addresses. If there are such addresses, delete them (after rewriting them somewhere, just in case) and check the system for viruses using anti-virus software installed on the PC - NOD32, Kaspersky, AdwCleaner, MalwareBytes, Dr.Web, etc. It is best to use Live downloaders for these purposes.

4. Check the settings of the router itself. The MTU parameter is most often lost. It is impossible to give universal recommendations for setting up a router, because... this directly depends on both the router model and the Internet provider. Typically MTU values ​​are 1500, 1460, 1476.

2xx Success

These types of responses notify users that client requests have been accepted and successfully processed. Depending on what the server's current status is, it may still send the headers and body of the message. In other words, this type of server response assumes that the action for which the client requested was accepted for processing without difficulty.

200 OK Status code 200 is probably the most popular, but at the same time very inconspicuous in terms of use. It indicates that the transfer of data between the server and the user has completed and everything went as it should. When should this code be used? Constantly!

201 Created A new resource was created due to the successful completion of the request. For example, thanks to a user request, a previously non-existent web resource such as a new page was generated. The origin server is configured to create the resource before sending the 201 code. If the document cannot be generated in a timely manner, the server uses code 202 (accepted) as an alternative.

202 Accepted The current request has been transferred to the processing stage, but due to objective factors it is incomplete. The request to the server may not be completed, it depends on whether the processing was successful and whether it was rejected.

In what cases can such a response be used? When the server is unable to fulfill a request at the time it is made. There is no forced execution of the request, and the client should not wait until the message is finally transmitted, since the likelihood of a long processing time is high.

203 Non-Authoritative Information The server was able to fully process the request, but the data being transmitted was not taken from the primary source (backup, another server, etc.) and therefore the information may not be relevant. This code is very similar to the 200 server response, but indicates that the data was not received from the source.

When is a server response like this used? It can replace the 200 code if the sender has good reason to believe that the response headers from the external source are different from those provided by the origin server.

204 No Content This code is the server response indicating that the request was received and understood. But there is no data that can be sent to the user. Basically, such code is used to activate scripts without having to make changes to the web document. The specified code must not contain the main message, and it must be inserted into the first code line, which is accessible immediately after the header.

When is this code used? It is used primarily when you need to enter or perform any action without needing to update a resource (such as a page).

205 Reset Content The code indicates the server successfully processed the request with no content being returned. Unlike the 204 code, this response requires that the document be updated.

When can this code be used? Typically it is used when a user fills out a form and the server sends a request to the browser to clear the form. It is similar to the 204 code, but requires the user to reset the document after processing is complete. For example, you need to clean up the HTML form after verification.

206 Partial Reset The server returns only the portion of the content that matches the header sent by the client. It is mainly used by advanced caching tools. This happens when the user wants to receive only a small part of the page's content, and the server provides data only for that part of the page in its response.

What are the uses for this code? This code is primarily used because of the If-Range query used in powerful cache validators. The hit must also include scope headers, which are used as parameters for the scope of the returned information.

207 Multi-Status The server provides the results of several independent operations in parallel, which are included in the body of the message in the form of an XML document.

What should the server response time be?

And straight away the specific numbers:

— the highest conversion is for pages that load completely in 1.8 and 2.7 seconds for desktop and mobile versions, respectively

— the lowest bounce rate for pages that load completely in 1 and 0.7 seconds for desktop and mobile versions, respectively

These figures are taken from a study by Akamai Technologies.

So, you have checked the site for loading speed. But how to react to the results?

  • <1 second is ideal
  • 1-2 seconds – almost ideal
  • 3-5 seconds – tolerable, but it makes sense to finish it
  • 5-10 seconds – bad, need to finish it urgently
  • ≥10 seconds – very bad, you need to finish it EMERGENCY

However, we must not forget one ultra-important rule - the download speed should be higher than that of competitors. Research from The New York Times has shown that a difference of 0.25 seconds can be enough to make visitors prefer a faster site. And before you can blink an eye (in the most literal sense), the user will leave you for a competitor.

Rating
( 2 ratings, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]