421 Misdirected Request β
Meaning β
The request was directed to a server that is not able to produce a response (for example, the request was sent to the wrong server due to reuse of a connection).
When to Use β
When the server host name in the request (URL) doesnβt match the server that received the request, often due to a connection reuse or misconfiguration in HTTP/2. The server signals that it cannot respond because it wasnβt meant to receive that request.
Example β
In an HTTP/2 connection, if a client erroneously reuses a connection for the wrong host, that server may respond with 421 Misdirected Request, telling the client to retry on a correct connection.
When Not to Use β
Do not use for general routing failures. This is specific to scenarios like virtual host misrouting. If the request is correctly routed but fails for other reasons, use a different status code.
Source β
RFC 9110