Free test available for France , UK or SG on Telegram Join Telegram •
HTTP Errors

406 Error (Not Acceptable): What It Means and How to Fix It

Officially, a 406 means the server won’t send the format you asked for. On most websites it means a firewall such as ModSecurity blocked the request. Here’s how to tell which one you have, and how to fix each.

PXM2 Proxies November 29, 2026 10 min read
406 Not Acceptable
4xx Client error, standard HTTP
Origin Never sent by Cloudflare
7+ Countries available
  • Two different errors, one code — a real content-negotiation failure, or a firewall rule borrowing the status.
  • Reproduced on a real server — ModSecurity and the OWASP Core Rule Set returning 406, with the log line that fired.
  • A fix for each reader — browsing, calling an API or running scripts, or owning the site.
  • An IP-block test — compare a direct request with one through a clean IP to see whether the block follows your address.
4G / 5G Mobile Proxies Clean Comparison IP
Protocol supportHTTP(S), SOCKS5
Session typeRotating or sticky
BandwidthUnlimited
HardwareDedicated 4G/5G modem
A Second, Clean Address

Real carrier IPs to compare against, so you know whether a block follows you.

Rules Out One Cause

If a clean mobile IP still gets a 406, the problem is the request, not the IP.

A 406 error (Not Acceptable) means the server refused to show the page in the format you asked for. It just wouldn’t provide it in that format.

That’s the official definition. But on most websites, a 406 usually means a security firewall (often ModSecurity) thinks your request is suspicious and has blocked it. Solutions differ by case, so first figure out which one you have.

MDN’s reference page for 406 Not Acceptable
MDN’s definition: the server “could not produce a response matching the list of acceptable values” and “was unwilling to supply a default representation”.

Quick Answer

Error 406
NameNot Acceptable
Type4xx client error (standard HTTP)
Official causeThe Accept headers asked for a format the server doesn’t offer
Usual cause on websitesA firewall such as ModSecurity blocking the request
Sent by Cloudflare?No, Cloudflare only passes it on from the site’s server
First fixFor browsers: clear the site’s cookies and retry. For APIs: fix the Accept header

What the 406 Error Code Means

Every HTTP request can state which formats it’s willing to accept. That’s known as content negotiation, and it’s done via headers such as:

  • Accept for the file type (for example, application/json or text/html)
  • Accept-Language for the language
  • Accept-Charset and Accept-Encoding for character sets and compression

If the server can’t come up with anything on that list and won’t just send a default, the standard response is 406 Not Acceptable.

Most servers don’t usually reach this point. MDN, which most developers use as a reference, says it can be better to send a default version with a 200 status instead of a 406. PyPI (the Python Package Index) does this clearly:

Real terminal output: PyPI returns 200 with its JSON format when asked for application/vnd.pypi.simple.v1+json, and returns 200 text/html when asked for application/xml
Here’s a live test with pypi.org. If you request a format PyPI supports, you get it. If you ask for something it doesn’t support, it just gives you HTML instead of a 406 error.

Strict APIs will return an HTTP 406. For example, this test API only supports JSON or CSV, so if you ask for XML, it rejects the request and tells you what formats it can send:

Real terminal output: a local API returns HTTP 406 Not Acceptable with a JSON body listing application/json and text/csv, then returns CSV when asked for text/csv
Here’s a real test on a local server. A helpful 406 error will tell you which formats you can request. If you ask for text/csv, the same endpoint responds normally.

Cloudflare doesn’t create 406 errors. If you see a 406 error on a site using Cloudflare, it’s actually coming from the site’s own server, and Cloudflare is just passing it along.

Why Websites Show 406 When Nothing Is Wrong With Your Format

On shared hosting, a 406 error often has nothing to do with formats. Many hosts use ModSecurity (a web application firewall) to check every request against a set of rules. If a rule is triggered, the host’s settings decide which error you see, and many use 406.

To show this, we set up Apache with ModSecurity and the OWASP Core Rule Set (a free rule set that many hosts use), and configured it to block requests with a 406 error, just like many shared hosts do:

Real terminal output: against an Apache server with ModSecurity and the OWASP Core Rule Set, a normal browser request returns 200, a request with User-Agent sqlmap returns 406, and a URL with a SQL injection pattern returns 406
Here’s a real test: three requests to the same page. A normal request loads fine. If the User-Agent looks like a hacker tool, it gets a 406. A suspicious query string, like one used in SQL injection, also gets a 406.

The server’s error log shows exactly which rule fired:

Real terminal output: the Apache error log shows rule 942100 SQL Injection Attack Detected via libinjection, Access denied with code 406 (phase 2), and rule 949110 Inbound Anomaly Score Exceeded
Rule 942100 picked up the SQL pattern, the request’s risk score went over the limit, and rule 949110 blocked it with a 406 error.

Real visitors trip these rules more often than you’d think. Common triggers include:

  • Form fields or URLs containing code, SQL words, or unusual characters
  • Long or odd cookies left over from an old session
  • A User-Agent string that’s missing or looks like a bot or scanner
  • Uploading files or pasting text that looks like a script

Some hosts will block your IP address in their firewall if you trigger ModSecurity rules too often. After that, the error is linked to your IP, not just your request.

Is It Just You?

  1. Read the error page.

    A lot of firewall error pages will say “Not Acceptable” and then have a line about ModSecurity or a request being blocked. That’s a firewall rule, not a format issue.

  2. Try loading the same page in a private window.

    A private window loads it without your cookies and extensions. If it works there, something in your regular browser was causing the issue.

  3. Try using a different network.

    Use something like your phone’s mobile data. If the page loads, your IP was probably blocked after triggering too many firewall rules.

If You’re Browsing

  1. Clear the cookies for that one site

    Then reload it.

  2. Turn off any browser extensions that change your requests

    Privacy tools, ad blockers, or user agent switchers — then reload the page.

  3. Change what you submitted

    If you got a 406 after sending a form, remove any code snippets, unusual symbols, or very long text, and try again.

  4. Try a different network

    If that solves the problem, wait a bit before using your usual connection again, or contact the site for help.

  5. Give the site owner the details

    Send the page address, the time, and what you were doing. They can use this information to find the matching entry in their firewall log.

If You Use an API or Run Scripts

Send an Accept header with the media type the server supports. Check the API docs for the exact type (some APIs use their own, like GitHub’s application/vnd.github+json). If you’re okay with any format, Accept: */* lets the server choose.

Python · requests
import requests

resp = requests.get(
    "https://api.example.com/items",
    headers={"Accept": "application/json"},
    timeout=30,
)
if resp.status_code == 406:
    # A well-behaved API lists what it can send in the body
    print("Not acceptable. Server says:", resp.text[:300])

Also check Accept-Language and Accept-Encoding. If you ask for a language the site doesn’t support, or a compression format the server can’t provide, you can get a 406 error too.

Don’t mix up 406 and 415 errors. A 406 is about the format you want to receive. A 415 Unsupported Media Type is about the format you’re sending (your Content-Type). Changing the Accept header won’t fix a 415.

Look like a normal client. If the site is returning a 406 to your script but loads fine in a browser, then it’s very likely a firewall rule is matching on your headers. Send a real User-Agent and normal headers, and absolutely don’t send test strings that look like attacks.

Check if your IP is blocked. If you keep getting 406 errors and even simple requests fail, the site’s host has probably blocked your IP. Try comparing with a clean IP:

Terminal · direct vs. proxied
export PROXY="http://USERNAME:PASSWORD@uk1.pxm2.io:PORT"
URL="https://target.example/page"
curl -s -o /dev/null -w "direct: %{http_code}\n" "$URL"
curl -s -o /dev/null -w "proxy:  %{http_code}\n" -x "$PROXY" "$URL"

If a direct request gives a 406 but a proxied one returns a 200 with the same headers, your IP is blocked. If both fail, the issue is with your request, so a new IP won’t help. Always check any IP you use first — see our guide to IP reputation and trust scores.

Use only public data, follow each site’s terms and conditions, and slow down if you notice a site blocking you.

If You Own the Site

Find the rule. Search your server’s error log for ModSecurity entries at the time of the error:

Terminal · Apache error log
grep -i "modsecurity" /var/log/apache2/error.log | grep "406" | tail -n 5

On cPanel servers, the log is typically located at /usr/local/apache/logs/error_log. Note the rule ID in the matching lines.

Fix the false positive, not the whole firewall. Turning off ModSecurity for your entire site removes important protection. Here are better options:

  1. Ask your host to whitelist (turn off) that specific rule ID for that page.
  2. On a VPS, turn off that rule for the path in question.
  3. If your control panel has a ModSecurity tool, use that to test the changes on a per-domain basis before you turn anything off.

For your own API, send a default format if possible. If a client requests a format you don’t support, it’s usually better to return your main format with a 200 status instead of a 406. If you must return a 406, include a list of supported formats in the response body, like the test API above.

Check your language and character set settings. Cloudflare notes that the 406s it passes on are typically caused by settings on the origin server, such as language or character set.

406 vs. Similar Errors

Error Name What it means
400Bad RequestThe request itself is broken
403ForbiddenYou’re not allowed to see this (many firewalls use this instead of 406)
405Method Not AllowedWrong method, such as POST where only GET works
406Not AcceptableCan’t send any format you asked for, or a firewall blocked you
415Unsupported Media TypeThe server won’t accept the format you sent
429Too Many RequestsYou’re sending requests too fast

If it’s a page on Cloudflare and you’re seeing a 1xxx error (e.g., 1005, 1015, or 1020), then that’s Cloudflare blocking you, not the site’s server. Our guide to common scraping blocks shows how to tell those apart, and if a Cloudflare site shows a 522 instead, see what a 522 error means.

Test With a Clean IP Yourself

Live PXM2 locations — real 4G and 5G carrier IPs to compare against your own connection. Ask support for a free 1-hour trial and test your target site:

🇫🇷

France

4 Operators 20-100 Mbps
Starting from
$4.34 for 1 hour
4G
Available Operators:
Orange Bouygues SFR Free Mobile
🇮🇳

India

1 Operator 20-30 Mbps
Starting from
$2.74 for 1 hour
4G
Available Operators:
Airtel
🇵🇱

Poland

1 Operator 20-80 Mbps
Starting from
$3.99 for 1 hour
4G
Available Operators:
Play
View all locations →

Frequently Asked Questions

What does an HTTP error 406 mean?

The server couldn’t return a response in any of the formats your request accepted. Often, though, it means a security firewall blocked your request.

Is it my fault that I’m getting a 406 error?

Sometimes. If you’re calling an API, your Accept header might ask for a format the API doesn’t support. If you’re browsing, it’s usually a firewall rule that’s too strict, and the site owner needs to fix it.

How do I fix a 406 Not Acceptable error in the browser?

Clear the site’s cookies, turn off any extensions, and remove any unusual text from forms you’ve submitted. If it still doesn’t work, try another network or contact the site.

Can a VPN or proxy fix a 406 error?

A VPN or proxy will only help if your IP was blocked after too many firewall hits. If the 406 is caused by your headers or what you submitted, it will happen from any IP.

Does a 406 error impact SEO?

Yes, if Googlebot encounters it. Google treats 4xx pages as missing and removes them from its index. Make sure your firewall isn’t blocking search engine crawlers.

Why does ModSecurity return a 406 rather than a 403?

It’s a configuration choice. ModSecurity returns whatever status the server admin sets for blocked requests. Some hosts use 403, but many shared hosts use 406.

Once you know whether a block follows your request or your IP, the rest of the cluster covers the fix in detail.

Web scraping guides

Core mobile proxy guides

Find Out Whether the 406 Follows Your IP

Real 4G/5G carrier IPs on dedicated modems — compare your target from a clean address. Ask support for a free 1-hour trial.

Try a Clean Carrier IP

Sources: MDN: 406 Not Acceptable · Cloudflare Docs: Error 406 · InMotion Hosting: 406 Not Acceptable Error · Namecheap: What is ModSecurity · OWASP Core Rule Set · Google: How HTTP status codes affect Google’s crawlers