HTTP 406 Not Acceptable
HTTP 406 Not Acceptable means the server cannot produce a response in any format the client listed in its Accept headers (Accept, Accept-Language…
Quick answer
HTTP 406 Not Acceptable means the server cannot produce a response in any format the client listed in its Accept headers (Accept, Accept-Language, Accept-Encoding). In practice it is often returned by over-strict security rules such as mod_security rather than real content negotiation.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 406 Not Acceptable mean?
Most servers ignore unmatched Accept headers and send a default format instead, which is usually friendlier. When a 406 appears unexpectedly on a shared host, a WAF rule matching the request is the common cause.
| Status code | 406 |
|---|---|
| Name | Not Acceptable |
| Class | 4xx Client Error |
| Defined in | RFC 9110 §15.5.7 |
| Cacheable by default | No, unless Cache-Control says so |
| Safe to retry automatically? | No: change the request first |
| Related headers | Accept, Accept-Language, Accept-Encoding |
What causes HTTP 406?
- The client requested a format the endpoint cannot return (for example Accept: application/xml on a JSON-only API).
- mod_security or another WAF rule rejecting the request.
How do I fix HTTP 406?
- Send Accept: application/json (or */*) from the client.
- On shared hosting, check WAF/mod_security logs for the rule that fired.
What should a client do after HTTP 406?
Adjust the Accept headers and retry.
Does HTTP 406 affect SEO?
If Googlebot gets 406, the page will not be indexed. Check that WAF rules do not fire on crawler requests.
Example 406 response
HTTP/1.1 406 Not Acceptable
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json
{"error":{"status":406,"message":"Not Acceptable"}} How to return 406 Not Acceptable in code
Express (Node.js)
res.status(406).json({ error: 'Not Acceptable' }); Next.js route handler
return Response.json({ error: 'Not Acceptable' }, { status: 406 }); FastAPI (Python)
raise HTTPException(status_code=406, detail="Not Acceptable") PHP
http_response_code(406); Nginx
location = /example {
return 406;
} Other 4xx status codes
The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request
Frequently asked questions
Why do I get 406 on WordPress?
406 vs 415?
Is 406 a client or server error?
Related
- 415 Unsupported Media Type HTTP 415 Unsupported Media Type means the server will not accept the request body’s format, as stated by its C.
- 400 Bad Request HTTP 400 Bad Request means the server cannot process the request because of a client error, such as malformed .
- 403 Forbidden HTTP 403 Forbidden means the server understood the request but refuses to allow it.
- Open the HTTP Status Codes Reference → Free, no signup.