How HTTP Works
5xx · Server error
< HTTP/1.1 506 Variant Also Negotiates

506 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.

Reviewed 2 min readadvanced3 sourcesTry itMarkdown
Cacheable
Only with explicit freshness
Retry?
No: server misconfiguration
Usually sent by
Origin (content negotiation)
Spec
RFC 2295 §8.1
On this page

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

  1. Identify the resource and open its type map or look at the files MultiViews would match.
  2. Replace nested type maps with a flat list of concrete files.
  3. If the negotiation involves rewrites, make sure a rewrite does not send the chosen variant back through the negotiated path.
  4. Disable what you do not use: Options -MultiViews makes 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

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

  1. MDN Web Docs: 506 Variant Also Negotiatesdeveloper.mozilla.org
  2. RFC 2295 Section 8.1: 506 Variant Also Negotiatesrfc-editor.org
  3. Apache httpd: Content Negotiationhttpd.apache.org

Keep going

Browse /search