What is "406-Not Acceptable Response" in HTTP? | ResultFirst

What is “406-Not Acceptable Response” in HTTP?

As you go through the immense complex superhighway of information called the internet, the browser you use (client) and the resources you tap into (servers) talk to each other. A lot. And sometimes, things can go wrong in any way possible. 

Jumping into the fray is the 406 Not Acceptable status code. This HTTP response is the server’s way of telling you, “We can’t do this for you.” 

This feedback condition appears on your screen when the server gets what you’re trying to look for but can’t give it to you in the way you want.

Let’s say you’re somewhere to eat. You’re ordering a dish in a way that’s very different and specific, say vegetarian, but it tastes like fish. 

But the chef can only make the dish with fish. So the one who takes your order gets it, but they can’t give you a vegetarian dish without fish since he’s not capable of it. 

That’s what a 406 error is like in the digital world. This is more or less how the whole process happens:

  • Client’s Request: When you’re hopping onto a web page, your browser sends a request to the server. This is done with an Accept header. This header states exactly the format you want back, like JSON, XML, or HTML.
  • Server’s Dilemma: Think of it like the server is going through its cooking pantry (or database) and then suddenly realizing they can’t make the food you want.
  • 406 Response: Instead of leaving you hanging, the server sends back a 406 Not Acceptable status code, letting you know it can’t meet your request as asked.

A lot of the time, servers will attempt to put something in front of you, even if it’s not something you asked for, like the chef giving you cheese that tastes like broccoli. They do this even if what they give you doesn’t match what you asked for.

But in the case when a 406 is triggered, it’s like the server is trying to tell you, “Sorry, I don’t have any replacements that can possibly satisfy your request.” 

Though, this code doesn’t appear a lot because servers default to a typical style if they can’t give the client what they want.

So, basically, a 406 Not Acceptable response is the server’s way of handling expectations from the client. As a result, it makes sure that communication remains straightforward even when it can’t give the client what they asked for.

What causes a 406 status code?

In all the years you’ve spent on the internet, you must’ve stumbled on the “406 Not Acceptable” error at least once and thought, “What happened?”. No? It can be confusing. So we’ll break it down here in this section.

This error pops up when the server can’t deliver the content in the format the client wants.

Here’s a closer look at why this might happen:

  • Unsupported Format: It might so happen sometimes that the server just doesn’t have the material in the style the client wants. Say you’re looking for a video file in a particular codec, but it only has it in a different one. Then boom. You get this error.
  • Accept Headers: When you’re visiting a web page, your browser will include something called an “Accept” header when it sends messages to the server. 

This header lets the server know what kind of content the client can handle. If the server can’t fulfill any of the criteria, then you’ll see a 406 error.

  • Character Encoding Issues: This happens when the client asks for an exact character encoding type that the server isn’t able to fulfill. This error will pop up on the user’s screen. It’s like asking a library if they have a book in a particular language and they don’t have it.
  • MIME Type Mismatch: This is mostly related to media, like when the client asks for a particular media type, like a PNG or JPEG image. But the server is unable to send it over to the client.

Sometimes, the server and the client not being able to communicate efficiently is part of the problem. The server tries to do what it’s told but can’t fulfill the client’s request because it just doesn’t have an answer for it.

Preventing the 406 Error in the Future

Trying to get the 406 error fixed can sometimes be a long drag. But what if there are ways to stop it from happening in the future?

I’ve listed below a bunch of things you can do to keep your website running in good condition without errors like 406 getting in the way.

  • Install only necessary plugins and themes: It might be tempting to put every cool plugin or theme that strikes your fancy, but doing it too much can cause problems. 

Just stick to what’s important and make sure that what you install is only from verified sources.

  • Avoid modifying core files: Unless you’re absolutely sure of what you’re doing, steer clear of changing the core files of your CMS. Missteps here can trigger errors like 406.
  • Regularly clean and optimize your database: Just like anything in life, keeping your database neat and clean will minimize the chances of errors occurring. 

You can also use a reliable cleaner plugin that can run automatically in the background to help tidy your website database. 

  • Debugging is your friend: You should routinely debug your server and web applications. It’s not that hard because many platforms offer built-in debugging functions that let you nip issues in the bud.
  • Set up automated backups: Backups are something that must be regularly set up. But it becomes a menial task. 

So setting up automatic backups is a more viable solution. If something ever goes wrong, you can restore your website to a previous state with minimal hassle.

  • Manual backups before updates: But even if you do have automated backups, it’s still safer to do it manually from time to time. Especially before you make any changes or updates. Better safe than sorry, right?

You should keep in mind that if you see a 406 error, it’s mostly because of excessive fetching frequency. If you follow the steps I’ve talked about above, it’ll help you keep your website away from problems you don’t want.

Does a 406 status code affect search engine optimization (SEO)?

A 406 status feedback can actually affect your SEO and all the hard work you’ve put into it. How? Let me explain.

When search engines like Google and Bing go through your website, they’re doing so with the expectation that every web page is accessible and indexable. 

Now imagine that they’re hit with a 406 Not Acceptable error in the process. It means they can’t look at the material in the style that they want. What happens after that? It can lead to problems like:

  • Indexing Problems: The most obvious problem will be that search engines won’t be able to index the pages that show this error if they can’t scan the material. This will affect your website’s health in terms of visibility in search engines. 
  • Crawl Errors: Too many 406 errors will lead to them being considered crawl errors in search engine processes. This will tell search engines that your website has problems, which is not a good thing.
  • User Experience Impact: It goes without saying, but if a visitor comes to your website and notices that these errors are popping up on almost every page they try to visit, then they’re going to go away. Basically, it’s going to result in higher bounce rates.

“A site plagued by 406 errors might be viewed as unreliable by both users and search engines, potentially impacting its ranking and traffic.”

Unless you want any of these problems to plague your cherished website, then you must try to make sure that your server configuration is able to keep up with any kind of content requested by search engines and users alike.

Make it a routine to go through your website for errors and fix any 406 issues to maintain good SEO health.

When Does a 406 Error Occur?

A 406 error pops up when the server can’t deliver the content in a format that the client, like your browser, can accept. This issue often arises due to mismatches in the requested and available content types. Let’s break it down further.

As we discussed earlier, 406 feedback comes up when the server can’t give the content the client asked for in the format that they want.

Basically, this is a problem that happens because of mismatches in both the request and available material. Take a better look below, whether you’re a web developer or just a user:

Steps for Web Developers

  1. Inspect Header Requests: The first thing you can do as a web developer is to take a look at the Accept- headers in the HTTP requests. 

This involves checking the Accept, Accept-Language, Accept-Charset, and Accept-Encoding headers to ensure they align with what the server can provide.

  1. Check Server Configuration: There is also the possibility of the server settings being misconfigured, which in turn leads to this kind of error. 

Get your server in order to be able to handle the desired MIME types and character sets.

  1. Review Code for Errors: Something as simple as a small typo or a missing piece of code can be behind a 406 error. Double-check for such mistakes in the source code.

Steps for End Users

  1. Verify the URL: Just see if the URL you put in is correct and doesn’t have any typos. In the digital world, simple typos or a single mistake in the code can cause problems.
  2. Reset Your Network: If that doesn’t work, then you can try resetting your internet connection. It might not work for most cases, but it’ll work if the problem is network-related. 
  3. Clear Browser Cache: The last method you can try if nothing works is clearing the browser cache. Doing this could solve the error as it will remove outdated or corrupted data.

You should keep in mind that if you encounter a 406 error as a user, there’s nothing much you can do most of the time. It might be because of a server issue and not on your end. So you can’t really fix it as a regular user.

Conclusion

So, there you have it. The 406 status feedback may not be as popular as some of the other errors, the 201 status code and 101 status code that most users come across, but it can still be a headache for the layman. 

No matter if it’s because of unsupported formats or miscommunicated headers, understanding why it happens in the first place is still useful to know.

If you ever run into this issue, take a look at those headers and server settings. If nothing fixes it, then your last option is to just contact the admin.

 

Yes, it can. Search engines might not index pages that return a 406 error, which could negatively impact your site's visibility.

Not really. It's a relatively rare error compared to others like 404 or 500. It typically arises from specific content negotiation issues between the client and server.

What to Read Next

ResultFirst is the ONLY SEO agency
you will ever need.

Our Pay for performance SEO programe helps companies
achieve impressive results