HTTP error 406 not acceptable is an error code displayed on your site when the server is unable to understand the request your browser sends. It is an unusual status code, with the most common error status codes being 404, 500 and 301.
When a browser client attempts to communicate with the web server, it will first obtain the IP address from the DNS. Next, it will launch an IP socket connection to the retrieved IP address and write the HTTP data stream in the socket. In the last step, it receives the HTTP data stream that contain the status code from the web server. The problem occurs in the last step when the HTTP 406 status code is sent to the web browser client.
Stop getting errors on your website. Choose Hostgator, the #1 Rated Hosting Provider.
Get 30% Discount with the code BINGO. Get Unlimited Bandwidth
Why Did You Get the HTTP Error 406?
When the browser send a request, it will dispatch an Accept header. The browser client will specify the characteristics of the data that it accepts. There are many types of accept headers including accept-charset, accept-encoding and accept-ranges. The Accept header informs the server about the format in which the browser want to accept the data. The server will return the HTTP error 406 not acceptable if it is unable to send data in the requested format.
It means that the file exists but the client system did not understand the requested file format. This is because the MIME type specified in the Accept header fails to match with the MIME type specified in the requested file name extension. The browser can only accept data that it knows how to process such as HTML and GIF files. If it is a file that it cannot process such as multimedia file, it will return the 406 error message.
Making Changes to the Accept Header
You can fix this problem by modifying the Accept header so that it matches with the MIME type specified in the file extension on the server. To modify the Accept header, you must launch the IIS Manager in your cPanel and click on Web Sites to see the list of websites you want to make the changes. Next, you must select MIME Types in Features and choose the MIME Type you want to make changes.
Finally, you have to enter a proper MIME type for the file extension in the MIME Type box.You can find out the types of files that are not accepted by going to the preference settings in the browser. It is also encouraged that you check the headers of the incoming response to make sure that it is acceptable.
Disabling the Mod_Security Rule Setting
One reason why you are seeing the HTTP error 406 is because there is a mod_security rule setting on the server. Many web hosting companies set up the mod_security rule on their Apache web servers to protect it from hackers. Mod_security is a firewall program that constantly scan the Apache server.
If the error is caused by the mod_security, you can turn off this feature by disabling the setting. It is possible to disable the ModSecurity rules for selected domains with the Modsec manager plugin in the cPanel. The Modsec Manager is found under Security in your cPanel.
Many web hosting companies do not give customers on VPS or dedicated hosting plans the options to disable the mod_security setting. If you don’t have access to cPanel, you can disable the mod_security through the SSH command line. If you only want certain rules to be disabled, you have to contact your web hosting company to help you disable them.
Conclusion
In conclusion, it can be annoying to keep on receiving the 406 error message when you are trying to perform some tasks on your website. You should contact the web hosting company if you are a newbie and don’t know how to fix the issue yourself. The web hosting company has technical specialist that can help you to detect the root cause of the HTTP error 406 error and get it resolved.