Navigation
Introduction
HTTP Status Code 421-Misdirected Request is one of the classes of 4xx(Server Error) response code that indicates the request was sent to a server that was unable to respond.
This can be delivered by a server that isn’t set up to respond to the request URI’s combination of scheme and authority(RFC 7540: Hypertext Transfer Protocol Version 2).
In general, terms, When a server receives an HTTP request that was not meant for it, it should return a 421 Misdirected Request.
General Understanding
Although this status was introduced with HTTP/2, it might also apply to HTTP/1 servers. A server could get the following HTTP request, for example:
GET /contact.html HTTP/1.1 Host: foo.example.org |
A client is required to include a Host header since HTTP/1.1. If a server already knows that the foo.example.org domain isn’t configured on it, it can respond with a 421 Misdirected Request response to inform the client that they’ve connected to the wrong server:
HTTP/1.1 421 Misdirected Request Content-Type: text/Html <h1>Switchboard operator error</h1> |
One example is when a server’s DNS is assigned to the incorrect IP or CNAME, or when a server configuration error occurs.
There are additional scenarios in which this may happen. Connection coalescing in HTTP/2 will allow a single HTTP/2 connection to be utilized for many domain names.
If a client tries to utilize this feature but the server doesn’t support it, 421 Misdirected Request must be returned. This is the genuine reason for the introduction of this status.
Status
421 MISDIRECTED REQUEST |
Possible Cause
There are additional scenarios in which this may happen. Connection coalescing in HTTP/2 will allow a single HTTP/2 connection to be utilized for many domain names.
If a client tries to utilize this feature but the server doesn’t support it, 421 Misdirected Request must be returned. This is the genuine reason for the introduction of this status.
Possible Solutions
The following are some of the most prevalent techniques for resolving the problem:
1. Using SSL for each domain separately 2. Redirection to HTTPS is disabled. 3. Clearing the cache in your browser |
Related Articles
FAQ
What does HTTP Status Code 421-Misdirected Request mean?
HTTP Status Code 421-Misdirected Request is one of the classes of 4xx(Server Error) response code that indicates the request was sent to a server that was unable to respond.
In general, terms, When a server receives an HTTP request that was not meant for it, it should return a 421 Misdirected Request.
What are the causes of HTTP Status Code Error 421?
There are additional scenarios in which this may happen. Connection coalescing in HTTP/2 will allow a single HTTP/2 connection to be utilized for many domain names.
If a client tries to utilize this feature but the server doesn’t support it, 421 Misdirected Request must be returned. This is the genuine reason for the introduction of this status.
How can we solve the 421-MIsdirected Request error Code?
The following are some of the most prevalent techniques for resolving the problem:
1. Using SSL for each domain separately
2. Redirection to HTTPS is disabled.
3. Clearing the cache in your browser
421 CODE REFERENCES
Rails HTTP Status Symbol | :misdirected_request |
Conclusion
I hope this article was able to help you with your doubts and queries related to this topic.
Still, if there are any queries related to this topic, feel free to ask in the comment section, we would be happy to assist you.
Hope you enjoy this article.Thank you.
Saurabh Chalise