What does HTTP 421 mean?
The request was sent to a server that cannot answer for that host name. Seen with HTTP/2 connection reuse: the browser reuses a connection for another domain covered by the same TLS certificate, but the server is not configured for that domain.
4xx Client error: The request has a problem the client can fix: wrong URL, missing credentials, bad data or too many requests.
How to fix 421 Misdirected Request
- Make sure every host name on a shared certificate is configured on the server, or use separate certificates.
421 and SEO
Can block crawling of affected host names until fixed.
Example response
HTTP/1.1 421 Misdirected Request
How to return a 421 response
Node.js (Express)
res.status(421).json({ error: 'Misdirected Request' });PHP
http_response_code(421);Python (Flask)
return {'error': 'Misdirected Request'}, 421Go (net/http)
w.WriteHeader(421)nginx
return 421;
Related status codes
- 400 Bad Request — The server cannot process the request because it is malformed.
- 502 Bad Gateway — A gateway or proxy got an invalid response from the upstream server.
Check which status code a URL returns with the HTTP header checker.