WordPress 404 Error on Save or Update

A relatively strange error encountered by some WordPress users is the generate of a file-not-found or 404 error when a particular post is saved or updated.  To the user, the error seems almost random and generally leads to speculation that one of the plugins and sprung a leak.

The problem, I found, is actually security settings on the server.  Mod Security or Mod Security 2 block certain phrases and links from being saved as a means to protect the server from hackers.

Apart from changing your content, the solution is to disable to specific rules that trigger the error.  If you are using Mod Security, then adding a single line to the .htaccess file in the root directory may work (source):

SecFilterEngine Off

In the case of Mod Security 2, you’ll have to contact your web host administrator for help.  if you ahve root access, the fix can be found here:

Open the file /usr/local/apache/conf/modsec2/whitelist.conf

Add the following:

<LocationMatch "/wp-admin/post.php">
SecRuleRemoveById 300015 300016 300017
</LocationMatch>

<LocationMatch "/wp-admin/admin-ajax.php">
SecRuleRemoveById 300015 300016 300017
</LocationMatch>

<LocationMatch "/wp-admin/page.php">
SecRuleRemoveById 300015 300016 300017
</LocationMatch>

Restart apache.

After running into a number of problems I implemented this second solution and it worked very well.

 

 

Genesis Theme Framework

The AdeptPlus.net blog has been redesigned using the Genesis Framework by Studiopress.

Switch to our mobile site