< HTTP/1.1 506 Variant Also Negotiates506 Variant Also Negotiates
506 Variant Also Negotiates is a server configuration error in transparent content negotiation (RFC 2295). See what triggers it in Apache and how to fix it.
- Cacheable
- Only with explicit freshness
- Retry?
- No: server misconfiguration
- Usually sent by
- Origin (content negotiation)
- Spec
- RFC 2295 §8.1
TL;DR: 506 means the server’s content negotiation is circular: a variant it wants to serve is itself negotiated. It comes from RFC 2295 (transparent content negotiation), is almost never produced by modern stacks, and when it does show up the cause is a misconfigured Apache type map or MultiViews setup.
What it means
Content negotiation picks one representation of a resource (for example /doc as doc.en.html or doc.fr.html) based on Accept-Language and similar request headers. RFC 2295 defined a protocol for doing this transparently across caches, with a Negotiate header and variant lists. A resource used to choose among variants must point at concrete variants. If a chosen variant is itself a negotiating resource, the process can recurse, so the server answers 506 (RFC 2295 §8.1).
GET /docs/guide HTTP/1.1
Host: example.com
Accept-Language: fr
HTTP/1.1 506 Variant Also Negotiates
Content-Type: text/html
Where you might see it
Apache’s mod_negotiation returns it with an error message to the effect that a variant for the resource is itself a negotiable resource, which indicates a configuration error. That happens when:
- a type-map file (
.var) lists a URI that itself resolves through another type map, or - MultiViews picks a file that Apache then treats as a negotiated resource again, for example because a handler maps the matched name back into a negotiated path.
Check the Apache error log for the exact message, then follow the variant’s target. A flat type map looks like this:
# type map for /docs/guide
URI: guide.en.html
Content-type: text/html
Content-language: en
URI: guide.fr.html
Content-type: text/html
Content-language: fr
Every URI: should be a concrete file. If guide.fr.html were itself a .var file with more variants, you would be in 506 territory.
Fix
- Identify the resource and open its type map or look at the files MultiViews would match.
- Replace nested type maps with a flat list of concrete files.
- If the negotiation involves rewrites, make sure a rewrite does not send the chosen variant back through the negotiated path.
- Disable what you do not use:
Options -MultiViewsmakes Apache stop negotiating by filename.
Try it with curl
506 Variant Also Negotiates comes from transparent content negotiation (RFC 2295), which is almost never deployed, so you cannot trigger it on demand. If a server sends one, curl -i shows it; the cause is a server misconfiguration, not something your request did.
curl -i -H 'Accept: text/html' https://example.com/resource
Related
- 406 Not Acceptable: no variant matches the request.
- 300 Multiple Choices: the server offers variants.
- 500 Internal Server Error
- Accept-Language and Vary
Frequently asked questions
What does 506 Variant Also Negotiates mean?
The server is configured so that the variant it picked for content negotiation is itself a negotiable resource. That makes the negotiation circular, so the server reports a configuration error.
Will I see 506 in normal web development?
Rarely. Transparent content negotiation from RFC 2295 is virtually unused. The status appears mainly in Apache with type maps or MultiViews pointing at another negotiated resource.
How do I fix it?
Make each variant listed for a negotiated resource a concrete file or a non-negotiating URL. Check type-map entries and MultiViews so they do not point at another type map or a directory that itself negotiates.
Is it the client's fault?
No. It is a server-side configuration error, so changing request headers does not help. Fix the negotiation setup on the server.
Sources
Related
501 Not Implemented
The server doesn't support the functionality required to fulfill the request. Learn about unimplemented features.
504 Gateway Timeout: nginx, ALB and Cloudflare Fixes
Fix 504 Gateway Timeout: nginx proxy_read_timeout (60s default), ALB 60s idle, API Gateway 29s, Cloudflare 524 at 125s, with error-log strings and curl timing.
505 HTTP Version Not Supported
Learn what 505 HTTP Version Not Supported means when servers reject protocol versions. Understand HTTP/1.1, HTTP/2 compatibility and version negotiation.
507 Insufficient Storage: What the Error Means
507 means the server ran out of space to store what your request needs. Where it comes from, including WebDAV, uploads and quotas, and what to check.