# 421 Misdirected Request

> https://http-status.org/docs/421

**Family:** 4xx Client Error

## Rationale

Request was directed to a server that cannot produce a response.

## In Plain Terms

You sent your request to the wrong server. It's like calling the wrong phone number - the person who answered can't help you.

## Description

The HTTP 421 Misdirected Request status code indicates that the request was directed at a server that is not able to produce a response. This can happen when connection coalescing is used in HTTP/2 and the server cannot or will not produce a response for the combination of scheme and authority included in the request URI.

## Server Perspective

### Usage
- Return 421 for connection coalescing, SNI, or virtual-host mismatches
- Use it when the failure is about the connection being routed to the wrong server rather than the resource being missing
- HTTP/2 connection coalescing issues
- Server cannot handle specific Host header
- SNI (Server Name Indication) mismatches
- Load balancer routing errors
- Virtual host configuration issues

### Implementation
- Keep 421 tied to connection-target mismatch, not generic routing errors
- Do not let caches treat it like a resource-level property

### Common Headers
- No status-specific header is required; connection authority, TLS/SNI, and routing context are the important signals.

### Body
- A body is optional; include a short explanation only if it will not expose routing details.

### Pitfalls
- Do not misuse 421 as a substitute for 404 or 400
- Do not cache a 421 as though it describes the resource itself
- Resource doesn't exist (use 404 Not Found)
- Bad request format (use 400 Bad Request)
- Authentication required (use 401 Unauthorized)

## Client Perspective

### Pitfalls
- Do not assume a 421 means the resource itself is missing

## Examples

### HTTP/2 connection coalescing mismatch

Server handling cdn.example.com cannot serve api.example.com requests

**Request:**
```
GET https://api.example.test/data
Host: cdn.example.com
```

**Response:**
```
421 Misdirected Request
Content-Type: application/json

{
  "error": "misdirected_request"
}
```

### Virtual host mismatch

Server received request for domain it doesn't serve

**Request:**
```
GET https://api.example.test/api/users
Host: wrong.example.com
```

**Response:**
```
421 Misdirected Request
Content-Type: application/json

{
  "error": "misdirected_request"
}
```

## Related Codes

- [400 Bad Request](/docs/400.md)
- [404 Not Found](/docs/404.md)

