What is a 4xx status code?
4xx status codes are used to indicate errors that occur on the client's side when a server processes a request. These status codes help inform the user about the specific type of error that has occurred.
When the server receives an incorrect or problematic request from the client, it will respond with a 4xx status code to communicate the issue.
The client needs to modify or fix their request to resolve the issue and receive a successful response from the server.
Types of 4xx status code
All the errors, from 400 to 499, have particular meanings that help troubleshoot the problem. We will discuss the most common ones only.
400 Bad Request
This error can occur when the request is incorrect due to URL syntax mistakes or corrupted files on the website. An invalid or expired cookie can also cause the same issue. The error may be displayed in various ways, such as:
"This page isn't working at the moment. If the problem continues, contact the site owner."
"Your client has issued a malformed or illegal request. That's all we know."
"Request header or cookie too large."
These messages indicate that there is an issue with the client's request, and the user may need to fix the problem or contact the site owner for further assistance.
401 Unauthorised
You may encounter this error when the credentials that the client is sending are not valid or authenticated. The common reasons can be those of “400 error”. Also, it can be a result of an incorrect username or password.
You can have the following messages:
Unauthorised
Access denied
These messages indicate that there is an issue with the client's authentication, and the user may need to verify their login information or contact the site administrator for further assistance.
402 Payment Required
The 402 status code was originally created to be used in digital payment systems within the context of HTTP response codes.
However, it has not been broadly adopted or used in real-world applications, and there isn't a universally agreed-upon standard for its use.
Consequently, this status code is still reserved for potential future implementation in digital payment systems or other applications that may arise within the HTTP response code framework.
As an example, a retail website might utilize the 402 status code to notify a user about specific payment-related issues, such as a problem with their payment card or other payment methods.
In this case, the 402 status code would serve as a way to communicate that there is an issue with the payment process that the user needs to address.
403 Forbidden
The 403 Forbidden error occurs when you are denied access to a specific website or resource, even if there are no issues with your credentials.
This can happen for various reasons, such as the website owner protecting their website from unauthorized access (e.g., to prevent hacking) or making a mistake while setting permissions.
The error may display messages like:
"Forbidden"
"You don't have permission to access"
These messages indicate that you are not allowed to access the requested resource or page, and you may need to contact the website owner or administrator for further assistance or clarification.
404 Not Found
The 404 Not Found error is a standard HTTP response code that occurs when the requested resource or webpage cannot be found on the server.
This error typically results from broken links, which are hyperlinks that do not connect a user to an external webpage because the page has been deleted or moved.
This issue can also arise when the website owner fails to properly implement redirection when moving a webpage to a different URL. Redirection is essential to ensure that users can still access the content at its new location.
The 404 error indicates that while you can connect to the server, the specific page you requested cannot be found. Common variations of this error message include:
This page doesn’t exist.
The requested URL was not found on this server.
405 Method Not Allowed
The 405 Method Not Allowed error is related to HTTP methods, which are used to instruct the server to perform a specific action based on the method included in the client's request.
This error occurs when the server does not accept or support the requested method. It may be a result of the improper configuration of the web server or the server intentionally restricting certain HTTP methods for security or other reasons.
406 Not Acceptable
The 406 Not Acceptable error occurs when the server cannot provide a suitable response format that aligns with the client's requested content, or when the server's response violates certain rules or criteria specified by the client.
In this situation, the client has specified its acceptable content types in the request, but the server is unable to deliver a response that meets those criteria.
To address this issue, the client may need to modify its request or contact the website administrator for further assistance.
407 Proxy Authentication Required
The 407 Proxy Authentication Required error is similar to the "401 Unauthorized" error, both of which are caused by invalid or missing authentication credentials.
The key difference is that the 407 error requires authentication credentials for a proxy server, rather than the main server. A proxy server acts as an intermediary between the client and the main server, processing requests on behalf of the main server.
In this case, the client needs to provide valid credentials to authenticate with the proxy server before it can access the requested resource on the main server.
408 Request Timeout
The 408 Request Timeout error occurs when the client's request takes too long to complete, causing the server to time out. This can happen when the server is too busy or overwhelmed to process the client's request in a timely manner.
Common root causes for this error include connectivity issues and heavy traffic, both of which can result in slow response times from the server.
409 Conflict
The 409 Conflict error can be considered a request-resource conflict, occurring when there is an inconsistency between the client's request and the current state of the resource on the server.
One common example of this error is a version conflict, where the requested information is not the same version as the information available on the server.
This can happen when a user attempts to upload a file that is older than the version already present on the server, resulting in a 409 error.
Additionally, this error can also arise from incorrect or conflicting input in specific fields, such as when two users attempt to modify the same resource simultaneously.
410 Gone
The 410 Gone status code indicates that the requested page or resource has been permanently removed and is no longer available on the server. As a result, the server cannot process the request for that specific resource.
411 length required
The 411 Length Required error occurs when an HTTP request is missing a required "Content-Length" header that specifies the size of the message body. An HTTP request typically consists of the following components:
Request line
Headers
Message body
When a server requires the length of the message body to be provided and the client's request does not include the "Content-Length" header, the 411 Length Required error is generated.
412 Precondition Failed
The 412 Precondition Failed error occurs when the server is unable to meet certain conditions specified in the "headers" of the client's request. This can happen during various operations, such as uploading a file or modifying a resource.
The client may set specific conditions using headers like "If-Match" or "If-Unmodified-Since," expecting the server to only process the request if those conditions are met. If the server cannot fulfil these conditions, it returns a 412 Precondition Failed error.
413 Payload Too Large
The 413 Payload Too Large error occurs when the size of the file or data being uploaded in a client's request exceeds the server's allowed limit.
This can happen when a client tries to upload a file or send data that is larger than the maximum size the server is configured to handle.
When encountering this error, you might see messages such as:
Request entity too large
Your client issued a request that was too large
414 request URI Too Long
The 414 Request-URI Too Long error occurs when the length of the client's request URI (Uniform Resource Identifier) is too long for the server to process. This can happen due to several reasons:
The length of the URI increases during the development process, as the developer adds more parameters or segments to the URI.
The website experiences redirect loops, causing the URL to be repeatedly appended with additional segments, making it excessively long.
The website is being targeted by attackers who attempt to exploit vulnerabilities or cause a denial of service by sending extremely long URIs.
415 Unsupported Media Type
The 415 Unsupported Media Type error occurs when a client sends a request containing a specific format that the server is unable to process.
This error typically arises when the client submits data or a file in a format that is not supported or recognized by the server, such as an unsupported image or document format.
416 Range Not Satisfiable
The 416 Range Not Satisfiable error occurs when a client sends a request for a specific portion of a resource, but the server is unable to fulfil the request because the specified range is either invalid or unavailable.
This error is typically encountered when a client uses the "Range" header in the HTTP request to retrieve a specific byte range of a file or resource, but the requested range is outside the bounds of the available data. For example, a client might request bytes 2000-3000 of a file, but the file is only 1500 bytes long.
417 Expectation Failed
The 417 Expectation Failed error occurs when a server is unable to meet the conditions specified in the "Expect" header of a client's request.
This error typically arises when the client sets specific expectations that the server is either incapable of or unwilling to fulfil.
422 Unprocessable Entity
The 422 Unprocessable Entity error occurs when a server is able to understand a client's request but is unable to process it due to issues with the request's content or format.
This error typically arises when the client submits data that is syntactically correct but semantically incorrect or violates certain validation rules or constraints.
Some possible causes of a 422 Unprocessable Entity error include:
The submitted data contains values that do not meet the server's validation requirements, such as a date in the wrong format or a string that is too long.
The request conflicts with the server's existing data or the server's expected state, making it unable to process the request as-is.
There are issues in the server-side code or database table that prevent the server from processing the request correctly.
425 Too Early
The 425 Too Early error occurs when a server determines that it is too early to process a client's request because there is a risk of a replay attack.
A replay attack is a type of cyber attack in which an attacker captures and resends or manipulates a valid request, attempting to exploit the system by resubmitting the same request.
This error typically arises when a client sends a request but the server considers the request to be premature or potentially vulnerable to such attacks.
426 Upgrade Required
The 426 Upgrade Required error occurs when a server determines that the client's protocol is not acceptable and requires an upgrade in order to process the request.
This error is typically encountered when the server is expecting a newer or more secure version of a protocol, such as HTTP/1.1 or HTTPS, but the client's request uses an older or less secure version.
When a server returns a 426 Upgrade Required error, it should also provide an "Upgrade" header in the response, indicating the required protocol(s) that the client must use for future communication.
428 Precondition Required
The 428 Precondition Required error occurs when a server requires a conditional request to be sent by the client, but the client's request is missing the necessary conditions in the header section.
Conditional requests are used to specify certain conditions or criteria that must be met before the server processes the request.
A common example of a conditional request is using the "If-Match" or "If-None-Match" headers, which specify that the server should only perform the requested action if the specified conditions regarding the resource's state are met.
429 Too Many Requests
The 429 Too Many Requests error occurs when a client sends too many requests to a server within a specified time frame, causing the server to become overwhelmed and unable to process additional requests.
Servers often impose rate limits to prevent abuse and ensure fair usage of resources among all clients.
When a server returns a 429 Too Many Requests error, it may also include a "Retry-After" header in the response. This header indicates the amount of time the client should wait before sending another request.
431 Request Header Fields Too Large
The 431 Request Header Fields Too Large error occurs when the size of the request header fields sent by a client exceeds the server's limits.
This can happen due to the overall size of the header fields combined or the size of a single header field. Common causes for this error include lengthy referrer URLs or an excessive number of cookies.
451 Unavailable For Legal Reasons
The 451 Unavailable for Legal Reasons error occurs when a requested resource is restricted due to legal reasons, such as government censorship, copyright infringement, or court orders. In these situations, the website owner or a relevant authority has chosen to block access to the resource to comply with the law or a legal ruling.
When a server returns a 451 error, it informs the client that the requested resource is unavailable for legal reasons and cannot be accessed.
The server may also include additional information in the response header to provide more details about the restriction.
How to fix them?
To fix various client-side errors, it is essential to address the specific issue causing the error. Here are some general actions you can take to resolve these errors:
Ensure that you have entered the correct URL, username, or password to avoid errors resulting from mistyped information.
Deleting cookies and cache can help the website run more smoothly, as expired cookies or outdated cached content can cause errors.
Try accessing other pages on the same website or pages on different websites to determine if the error is limited to specific pages or if it is an issue with your browser.
Ensure that the server is configured correctly, as improper configuration can lead to certain client-side errors.
If you are experiencing a serious issue and none of the above strategies are working, consider reaching out to the website's support team or administrator for assistance.
Remember, each error may have specific solutions, so it is crucial to identify the root cause of the error to determine the most effective approach to fix it.
How can it affect SEO?
Broken links can indeed have a negative impact on a website, as they can affect the user experience and may cause visitors to leave the site. It is essential to identify, fix, or remove broken links to maintain a high-quality website.
Generally, 4xx status codes can affect indexing because they suggest that the URLs are not accessible, and over time, search engines may remove them from their indexes.
However, it is worth noting that not all 4xx errors have the same impact on indexing.
For example, Error 429 (Too Many Requests) typically does not lead to the removal of the URL by Google, as it is a temporary issue that occurs when a server receives too many requests in a short period.
To minimize the impact of 4xx errors on your website's SEO performance, it is essential to regularly monitor your site for broken links and other issues, and address these errors promptly.
This will help ensure a better user experience, improved crawl efficiency, and better search engine rankings.
The bottom line
The 4xx status codes indicate client-side errors when a server processes a request, and there are several types of them.
These errors can impact the user experience and SEO, but they can be fixed by updating the sitemap, using redirection, and appropriate server configuration.