Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›HTTP 406 Not Acceptable
4xx Client Error

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 code406
NameNot Acceptable
Class4xx Client Error
Defined inRFC 9110 §15.5.7
Cacheable by defaultNo, unless Cache-Control says so
Safe to retry automatically?No: change the request first
Related headersAccept, 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?

  1. Send Accept: application/json (or */*) from the client.
  2. 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.

Frequently asked questions

Why do I get 406 on WordPress?
Usually mod_security on the host blocks the request (often a form submission or admin action). Ask the host to check which rule triggered.
406 vs 415?
406 is about the response format the client will accept. 415 is about the request body format the server will accept.
Is 406 a client or server error?
406 is in the 4xx class, so it is classed as a client error: the request needs to change before it can succeed.