506 Variant Also Negotiates
A server configuration error in content negotiation: the chosen variant is itself set up to negotiate, creating a loop.
What 506 Variant Also Negotiates means
Defined in RFC 2295 (Transparent Content Negotiation). The server's negotiation setup points to a variant that negotiates again, so it cannot pick a final representation.
It is rare and always a server-side misconfiguration.
Common causes
- A type map or negotiation rule (for example in Apache's mod_negotiation) where a variant points back to a negotiable resource.
- Transparent content negotiation turned on for resources that should not use it.
How to fix 506 Variant Also Negotiates
- As a visitor, nothing on your side will fix it. Contact the site.
- Check the server's content negotiation config and make each variant point to a real file.
Example response
HTTP/1.1 506 Variant Also Negotiates
Content-Type: text/plain; charset=utf-8
506 Variant Also NegotiatesHow to check for a 506 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 506) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 506:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 506 {
fmt.Println(res.Status)
}Specification
506 Variant Also Negotiates is defined in RFC 2295, section 8.1.
Related status codes
- 500
Something went wrong on the server and it could not complete the request. It is a generic error and not your fault.
- 300
The resource has more than one representation, such as different languages or formats, and the client needs to pick one.
- 508
The server stopped a WebDAV request because it found an infinite loop, usually from bindings processed with Depth: infinity.