Thursday, 10 November 2011

Apache Mod Security update, How to Fix ‘Error 406′ or ‘Not Acceptable’ issue





Few weeks ago I started having “Not Acceptable! Error 406” on one of my WordPress sites when trying to save a post or a page. I kept getting the following message when trying to save a post.
Not Acceptable
An appropriate representation of the requested resource /wp-admin/post.php could not be found on this server
I tried many fixes and nothing seemed to have helped getting rid of the issue. So I decided to reinstall WordPress (How to Uninstall and Reinstall WordPress). Even the reinstall didn’t help! Later I found out that the “Not acceptable! Error 406″ occurs due to Mod Security updates on the server. So if you are having a similar problem then you can try one of the following methods to fix it.

Solution 1

backup your ‘.htaccess’ file if you have one in the ‘wp-admin’ directory then make a ‘.htaccess’ file with the following content and upload it to ‘wp-admin’ directory.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
You can use any text editor such as Notepad to create this file.

Solution 2

This is the solution that worked for me for my WordPress site. backup your ‘.htaccess’ file if you have one in the ‘public_html’ directory. Open the ‘.htaccess’ file with any text editor and observe the lines between the “# BEGIN WordPress” and “# END WordPress” tags. Make sure the lines look somewhat like the following. If not then update the file with the following content and upload it to the ‘public_html’ directory.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Hopefully one of these solutions help fix your “Not Acceptable” error. Good luck.

ADVERTISEMENT

Related Posts Plugin for WordPress, Blogger...