What Are HTTP Status Codes and How to Solve Them?

what are http status codes and how to solve them

An HTTP status code is a message that a server sends to a client about the status of their request. It is displayed by your browser when you access a specific web page. This indicates that the upstream server encountered an error while processing a request.

You can find a variety of HTTP response status codes that are based on the response to the client’s request. They are useful tools for troubleshooting. It is important to understand the meaning of each status code in order to maintain website performance and search engine optimization (SEO).

In this article, we’ll talk about HTTP error codes and what are HTTP status codes.

 

What Are HTTP Status Codes?

So, what are HTTP error codes? Your browser sends a request for the page content to a web server when you visit a website. The server will process the request and send back the requested content together with an HTTP status code.

An HTTP status code is composed of three digits. The status type is indicated by the first digit. It can range from 1 to 5. The second and third numbers refer to the status codes that fall within the range of the first digit. The Internet Assigned Numbers Authority maintains more than 40 official state codes.

Your browser may not display the HTTP status code despite it being in the page’s HTTP header. To see all HTTP headers returned by the server, however, you can use the inspect tool in your browser.

If the server does not process the request, the status code will be displayed to the browser. The error will affect the status code.

 

Different Types of HTTP Status codes

There are five response classes for the HTTP response codes currently in use. Each status code class represents the type of communication between the web server and client.

These are the five HTTP status codes classes:

  • 1xx (informational): The server received the request and is currently processing it.
  • 2xx (successful): The server received the request successfully and returned the expected response.
  • 3xx (redirection): The server needs to take additional actions in order to fulfill the request because of resource relocation.
  • 4xx (client errors): The server can’t fulfill the request because of bad syntax.
  • 5xx (server Error): The server failed to fulfill a valid request.

Let’s discuss HTTP status codes and their different types in each class.

 

 

1xx Informational

The first HTTP error code comes from the 1xx class. The status code 100 indicates that the server continues to process the request. The error message is issued on a provisional basis and consists of a status line as well as optional header fields. It will be terminated if it is empty.

This class of HTTP status codes informs the user about the current process and prompts them to wait for a reply. A server can send multiple status codes during the same period.

 

100: Continue

This status code indicates that the server has not rejected request headers. It prompts the client for the message body.

It determines whether the server will accept the request without sending the request body. This makes the process faster.

 

101: Switching Protocols

The user agent has requested that the server switch protocols ensure optimal response delivery. Switching to a more recent version of HTTP, for example, will decrease download times and server latency.

 

103: Early Hints

This status code means that the client will receive some request header fields before the final HTTP message. This status code allows the user agent to preload resources while it waits for the process to complete. The final response from a server will usually include the same header fields.

 

2xx Successful

The second HTTP error code on our list is 2xx. The 200 status code class indicates that the server has received, understood and accepted the request.

 

200: OK

This is the standard response status code for successful HTTP requests. This code is sent by the server along with the requested resources to allow the web page to function normally.

The method used to request the information will determine this HTTP status code.

  • GET request: Contains the entity that corresponds to the requested resource.
  • HEAD request: Contains the request header fields that correspond to the requested resource, excluding the request body.
  • POST request: Describes or contains the result of an action.
  • TRACE request: Contains the request message the server received.

 

201: Created

This HTTP error code indicates that the request was successful. The server created a new resource and will send it back to the response body.

The Location header or the request’s Unified Resource Identifier (URI) identifies the newly created resource. The entity format is determined by the media type specified in the Content-Type header.

 

202: Accepted

Although the server has accepted the request, it has not started or completed the process. This response code allows the server to accept another process request without requiring the user agent not to keep the connection open until the process is completed.

 

203: Non-Authoritative Information

Only when you use a proxy server will this response code appear. Before passing the response status code to the client, the proxy server modifies 200 from the origin web server.

 

204: No Content

This status code indicates that the server has successfully processed the request, but it isn’t returning any content. The request will be terminated when there is no more content in the first line after the header fields.

This status code could be displayed on a page that has a “save” and “continue” function. After saving the changes successfully, the client does not need to leave the page.

 

205: Reset Content

Similar to the status code 204, 205 Reset Content signifies that the server has processed the request successfully but will not return any content. It asks the user agent to reset their document view.

 

206: Partially Content

This status code is generally displayed on browsers that support the HTTP header Accept-Ranges.

This indicates that the server processed the request successfully but did not send all requested resources according to the Range header.

 

3xx Redirection

The 300 status code class indicates that the user agent must take additional actions in order to fulfill the request. This is because the requested resource has been moved to another location. It usually includes redirects to the new location.

This status code class is generally found in URL forwarding because of its function. This status code may not be visible if you use the GET or the HEAD request methods. The user agent can perform the additional action in this instance without the need for user interaction.

 

300: Multiple Choices

This code is used to indicate that the user agent can choose from the available resources. This code is usually displayed when multiple filename extensions are used or ambiguity in the request.

 

301: Permanently Moved

This code is usually used with permanent page redirects. This status code communicates the resource’s permanent redirection to another URL. It is found in the Location headers.

Search engines will redirect all traffic to the new page if they encounter this status code, as the relocation is permanent. This status code is used by web owners when they transfer, change or merge two websites. Most SEO experts tend to use this method to replace the current ranking with another page.

 

How to solve error 301

Check the redirect configuration to ensure that redirection works flawlessly. You can switch to a WordPress plugin with Redirection if you’ve used it to ensure everything is redirected correctly.

 

302: Found

Similar to the status code 301, 302 Found redirects users to another URL. The browser is prompted to use the old URL for future requests, as the relocation is temporary.

 

How to solve error 302

A WordPress plugin is the best way to create a redirect for 302 addresses. You can download and use Rank Math directly from the WordPress directory or any other WordPress plugin that you prefer.

 

303: See Other

This status code means that a user has been redirected to a different page than the newly uploaded resource. The resource can be retrieved using a GET request method. It usually responds to HTTP PUT, POST or DELETED requests.

 

304: Not Modified

The server informs the browser that the resource has not changed since it was last cached. The browser can now access its cache to request the resource and reduce page load time.

 

305: Use Proxy

Only a proxy server can access the requested resource, as specified in the location header. The browser must connect to the proxy server and resend the request. This status code can only be generated by origin servers.

 

307: Temporary redirect

The redirect status code 307 Redirect serves a similar purpose as 302 Found. The only difference is that the 307 redirect doesn’t modify the HTTP method used or the message body of the original request.

Websites often use 307 Redirect to send confirmation messages.

 

308: Permanent redirect

308 Permanent Redirect is similar to 301 Moved Permanently. It is similar to 307 Redirect, except that it does not change the HTTP method or the original message body.

 

4xx Client Error

The 400 status code class is for events where a client-side error prevents the server from processing the request. It could be the browser itself or the request.

 

400: Bad Request

This error code indicates that the client-side error rendered the request unprocessable. The most common causes are faulty request syntax or invalid cookies.

 

401: Unauthorized

Because the request was not validly authenticated, the server could not process it. If the user insists on accessing the password-protected resource, the response must contain a WWW authentication header field.

 

How to solve error 401

You might have entered an incorrect URL, or your login URL may have changed. If that is the case, you can clear the browser cache or cookies.

 

402: Payment Required

This status code can be used in the future, as it was not intended to be used with digital payment systems. This code indicates that the server has refused to process the request due to the user not having made the necessary payment.

There is no set way to use it, so many eCommerce websites use the 402 Payment Required method to create paywalls.

 

403: Forbidden

The purpose of 403 Forbidden is similar to that of 401 Unauthorized. However, 403 Forbidden indicates that the request was not authorized. This is true even if valid login credentials are used. The user should not repeat the request.

Insufficient permissions are the most common reason. For example, a user who has a writer role and wants to access editors’ pages only.

 

404: Not Found

This status code tells the user that the server couldn’t locate the requested resource. It doesn’t indicate if the resource is temporarily missing or permanent.

The error message will vary depending on which browser you are using. A mistyped URL or caching issue, incomplete domain propagation, and a mistyped URL are some of the most common causes.

 

How to solve error 404?

It is essential to fix a broken link or, more precisely, a 404, but it is still a maintenance task. The .htaccess method is for you if you’re not a glutton for labor and don’t mind going the extra mile. You can also install the Redirection plugin in the WordPress directory.

 

Choosing the right VPS Hosting server is the best solution for 404 errors and other http errors.

 

405: Method not Allowed

The HTTP request method is supported by the origin server but not the target resource. The status code includes an Allow header that lists the supported methods for accessing the resource.

 

406: Not Acceptable

The Accept headers define the values that the server should not respond to. This status code is not used often, however, as servers will present the resource as is without regard to the value of the Accept header.

Similar to the 405 Method not Allowed, this status code often comes with a list of supporting entity characteristics.

 

407: Proxy Authentication Required

When using a proxy server, this client error status code is displayed. This code indicates that the user must first provide valid authentication credentials to the proxy server.

The status code is accompanied by a Proxy-Authenticate header that contains instructions for authorizing proxy servers.

 

408: Request Timeout

If a user does not submit a request within the specified time period, the origin server might send this code. This will deem the connection unutilized.

This error is usually caused by poor internet connections or incorrect URLs. The user can simply repeat the request again at another time without having to change the content.

 

409: Conflict

Because of a conflict between the target resource and the server, the server cannot complete the request. This error could be caused by multiple users simultaneously updating files or the new file being older than the one on the server.

 

410: Gone

This status code is very similar to 404 Not Found. The only difference is that 410 means that the resource is not found on the origin server and that there is no redirection.

 

411: Length Required

This response code may be sent by a server if the request does not include the Content_Length header that is required by the resource.

 

412: Precondition Failed

The request-header fields didn’t contain the required preconditions. This happens most often with requests that contain If Modified-Since and If None-Match headers.

 

413: Payload Too Large

Because the request was too large to process, the server refused to process it. This happens most often when a user attempts to upload a file larger than the server’s limit.

 

414: URI Too Long

Because the request URI was too long, the server refused to process it. This happens when a client incorrectly converts a POST to a GET request, the redirected URI prefix points at its own suffix, and/or if a client uses fixed-size buffers to attack a server.

 

415: Unsupported Media Type

The media type specified in the client’s request entities is not supported by the server.

 

416: Range is not Satisfiable

A client requested a part of the file, but the server couldn’t deliver it. This could be due to the fact that the requested ranges are not in the file or because the range request-header field is incorrect.

 

417: Expectation Failed

The Expect request header field indicates that the server cannot fulfill the requirements.

 

419: Authentication Timeout

This code is used to indicate that authentication has expired. This code is an alternative to the 401 unauthorized status code.

 

422: Unprocessable Entity

Semantic errors in the request prevented the server from processing it. The server cannot complete the request because it contains semantic errors, such as an incorrect operator or variable, which renders it meaningless.

 

423: Locked

Because the resource is locked, the server cannot access it. This error code is part of WebDAV specification and, specifically, its locking mechanism.

 

424: Failed Dependency

This error code is displayed when a request fails because it is dependent on another request. It’s similar to 423 Locked and is also part of WebDAV, an extension of HTTP.

 

425: Too Early

A replay request might not be processed by the server, which prevents hackers from launching replay attacks.

 

426: Upgrade Required

A client must upgrade to another protocol. The Upgrade message header field must contain the requested protocol.

 

428: Precondition Required

The origin server demands that the response be conditional. This means that the request must contain a precondition header. The server will return a 412 status code if the header does not match the server-side state.

 

429: Too many requests

A user has submitted too many requests in a short time. A Retry-After header may be included by the server. It contains a time period after which the user should send another request.

 

431: Too Many Request Header Fields

The server refuses to process a request because one or more HTTP header fields are too large. This response code typically indicates the problem header fields in the message body and allows the user to correct them.

 

440: Logged Out

A client must log in again as their session has ended.

 

444: No Response

This code, which is not standard, only appears in log files. It instructs the server to disconnect the client without sending a reply. This code is used to deny malicious requests.

 

451: Unavailable for Legal Reasons

Due to legal restrictions imposed by the client’s government, the server cannot access the resource.

 

495: SSL Certificate Error

The SSL client certificate has been deemed invalid by NGINX because it was not verified by the NGINX server.

 

496: No Certificate

The NGINX response code is displayed if a client does not have the required SSL certificate.

 

497: HTTP to

The NGINX response code can be extended to 400 Bad Requests. This occurs when a client sends an HTTP request via an HTTPS port.

 

499: Client Closed

Before the NGINX server responded, the client had already closed the request.

 

5xx Server Error

500 status codes signify a server-side error. When they are unable to find a better response, servers usually send 500 status codes.

 

500: Internal Server Error

Due to an unanticipated condition, the server was unable to fulfill your request.

This error can be caused by a WordPress plugin, theme, or corrupted .htaccess file. You may also experience an error due to insufficient PHP limits or incompatible PHP versions.

 

How to solve error 500?

It is not easy to fix the 500 Internal Server Error. There are many reasons for it.

 

501: Not Implemented

The server does not recognize the requested method or the functionality needed to fulfill the request.

This is the opposite of the 405 Method not Allowed response code, which means that the server recognizes the functionality required but does not support it.

 

502: Bad Gateway

Because it received an inexact response from the upstream server, the proxy server cannot fulfill the client’s request.

This response code could be generated if a domain name isn’t fully propagated following a move to a new host. Sometimes, the firewall may consider the request to be an attack on the origin server because of an incorrect configuration.

Another possible cause is an overload at the origin server and browser problems due to old browser versions or corrupted files stored in the browser cache.

 

How to solve error 502?

This can usually be resolved by refreshing your browser or clearing your browser cache. Try waiting 24 to 48 hours if you just migrated to the site. To check with the hosting provider, you can also reach them. Sometimes, your 502 response could be caused by a third-party CDN or WordPress plugin. If none of the above solutions work, you can try switching themes.

 

503: Service Unavailable

The server is currently down or out of resources and cannot process the request. This response code is usually sent by servers to address temporary issues. The response code includes the Retry-After request header field that contains the estimated recovery time.

 

504: Gateway Timeout

The request has not been fulfilled by the proxy server because it has not received a timely response from the upstream server.

The most common causes are faulty firewall configuration and unresolvable domains. Server overload, connectivity issues, limited workers, DNS issues, and server overload.

 

505: HTTP Version Not Supported

The requested HTTP protocol version is not supported by the server. This response code is usually triggered by an old web browser.

 

506: Variant also Negotiates

The server has completed the Transparent content Negotiation protocol. This prompts the user agent to choose from the supported variants in order to serve the resource.

This response code may indicate a circular reference in some cases. This indicates that the variant resource selected is set up to engage in content negotiation. The process is not finished.

 

507: Insufficient storage

This WebDAV response code indicates that the server does not have enough storage space to store the representation.

 

508: Loop Detected

This WebDAV response code means that the server encountered an infinite loop while processing the request.

The 508 error message can also be referred to as “Resource limit exceeded”. This means that the request cannot be fulfilled by the server because it exceeds the resource limit set by the web host.

 

509: Bandwidth Limit Exceeded

This response code is usually displayed on shared hosting plans. This code indicates that the server exceeded its bandwidth limit because of high site traffic volumes.

 

510: Not Extended

The client doesn’t use any extensions that are supported by the server. The client is not using any extensions supported by the server.

 

511: Network Authentication Required

This error message is sent to the network by intercepting proxy servers that control access. Before the network can grant access, the client must be authenticated.

This happens most often when you try to access public networks. To gain access, users must agree to the Terms of Service.

 

520: Web Server returned an unknown error

This Cloudflare response code indicates that the origin server returned an unspecified or empty response to the reverse proxy.

 

521: Web Server Down

This Cloudflare response code is displayed when the origin server can’t connect to the reverse proxy. This could be due to the origin web server blocking certain Cloudflare IP addresses.

 

522: Connection Timed Out

Cloudflare could not reach the origin server to establish a Transmission Control Protocol connection. This caused a timeout. This is most commonly caused by DNS misconfiguration.

 

523: Origin Unreachable

Cloudflare could not reach the origin web server. This can be caused by DNS settings or DNS records that are missing or incorrect.

 

524: A Timeout Occurred

Cloudflare established a TCP connection with the origin server. The reverse proxy has not received an HTTP response from the origin server within a specified time period, which results in a timeout.

 

525: SSL Handshake Failure

Cloudflare could not execute an SSL/TLS handshake with its origin web server. An incorrectly configured SSL certificate might prevent the client from connecting to the server.

 

599: Network Connection Timeout Error

This response code is sent by some HTTP proxy servers to clients when there is a network timeout.

 

Conclusion

It is crucial for webmasters and internet users to be able to understand HTTP status codes. In this article, we went over the most common HTTP error codes in the full list. Each status code indicates the client’s current state and informs the user if the server is able to retrieve the requested resource.

It is important to regularly monitor HTTP status codes as they have a significant impact on SEO. All of your pages should return 200 status codes, which indicates successful HTTP requests across the site.

Leave a Reply

Your email address will not be published.