HTTP 506 Variant Also Negotiates Error - Meaning & Fix

The HTTP 506 Variant Also Negotiates status code indicates a server error due to misconfiguration. It occurs when the selected resource variant is also set to perform content negotiation. This prevents the server from providing a definitive endpoint for the resource.

Main causes

  • Misconfiguration in the server's content negotiation settings where the selected variant is incorrectly set to perform further negotiations.

  • Incorrect server setup leading to a loop in variant selection, where a variant points to another negotiable resource instead of a final content.

  • Errors in the server's .htaccess or similar configuration files that improperly direct negotiation processes to negotiable variants.

  • Faulty implementation of the content negotiation protocol in the server software, causing it to select negotiable variants as endpoints.

# Request example 
curl -X GET https://sandbox.oxylabs.io/ -H 'Accept: */*;q=0.8' -H 'Accept-Encoding: gzip, deflate' -H 'User-Agent: Safari/537.36'

Try Scraper API with 5K results

Common fixes

  • Review the server configuration to ensure that the resource variants are not set to perform content negotiation themselves.

  • Check and update the content negotiation settings to avoid conflicts between resource variants.

  • Verify the server's algorithm for selecting resource variants to ensure it does not recursively negotiate.

  • Simplify the resource variant management to prevent overlap in negotiation roles and responsibilities.

# Response example 
HTTP/1.1 506 Variant Also Negotiates
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip

[Binary gzip-encoded data]

Forget HTTP errors with Scraper API

Web scraper API

Self-Service

Public data delivery from a majority of websites

From

49

Useful resources

Get the latest news from data gathering world

I'm interested