406 Not Acceptable: when content negotiation fails
406 Not Acceptable means the server has no version of the resource matching the client’s Accept headers and won’t send a default.
406 Not Acceptable means the server has the resource but not in any form the client said it would accept. “Accept” refers to content negotiation headers such as Accept, Accept-Language and Accept-Encoding. In real life, though, most 406s on websites come from security rules rather than negotiation. (Its mirror image is 415, which rejects the format of what the client sends.)
Definition
RFC 9110, section 15.5.7 defines 406 as: the target resource has no current representation acceptable to the client according to its negotiation headers, and the server is unwilling to supply a default. The spec leaves servers a choice: for Accept, it says the server can either send 406 or disregard the header and respond as if the resource weren’t negotiated. For public pages, the second option is almost always better.
Common causes
- ModSecurity on shared hosting. Many hosts configure this web application firewall to answer blocked requests with 406. A form submission, URL or query string that matches a rule triggers it.
- Strict API negotiation: a client asks for
Accept: application/xmlfrom an API that only produces JSON. - Language or format negotiation, for example Apache MultiViews, that finds no matching variant.
SEO impact
A 406 is a 4xx, so Google treats it like the others: the URL isn’t indexed and existing entries are removed (Google’s documentation). Crawlers send fairly generic Accept headers, but a strict rule or a WAF can still reject them, and pages that answer crawlers with 406 vanish from search.
How to fix it
- Site owners: ask your host which ModSecurity rule fired (the rule ID is in their audit log) and have it adjusted or disabled for your site.
- Developers: fall back to a default representation instead of failing. Serve HTML for page URLs whatever
Acceptsays, and when you do negotiate, addVary: Acceptso caches keep the variants apart. - Multilingual sites: don’t make the page depend on
Accept-Language. Give each language its own URL and connect them with hreflang.
How to check
Use the HTTP status checker to see whether a page returns 406 to a neutral client, and the HTTP header checker to inspect Vary and Content-Type. A 406 from an API looks like this:
HTTP/1.1 406 Not Acceptable
Content-Type: application/json
Vary: Accept
{"error":"Supported types: application/json, text/csv"} Frequently asked questions
Why does my form submission return 406 Not Acceptable?
On shared hosting this is usually ModSecurity blocking something in the submitted data. Ask your host which rule was triggered and have it adjusted for your site.
Should my API return 406?
Only when it truly can’t produce any format the client accepts. Many APIs simply return their default format, usually JSON, which the spec also allows.
Can a 406 error hurt SEO?
Yes, if crawlers receive it on page URLs: Google treats it like other 4xx codes and drops the page. Pages should always fall back to their default HTML.