[solved] 404 Error After Update or Save Post in WordPress

I don’t know from where it started but I was facing this problem that whenever I updated an earlier posted article in my WordPress blog the post just redirected to my website’s page showing 404 error.

The problem didn’t happen for a new post saved but occurred every time I updated an older post. After hitting the save button, the URL to which I get redirected was

http://mysite.com/wp-admin/post.php?action=edit&post=934&_wp_original_http_referer=http%3A%2F%2Fmysite.com%2Fwp-admin%2Fedit.php&message=1

However it should have been

http://mysite.com/wp-admin/post.php?action=edit&post=934&_wp_original_http_referer=http%3A%2F%2Fmysite.com%2Fwp-admin%2Fedit.php

This is how I fixed my problem:

1.    We need to edit our .htaccess file of the site which is stored in the root of the site.

2.    Run the ftp client to get access to the site’s directory and locate the .htaccess file which is stored in the public_html folder.

3.    Download the file and edit it using the text editor (open it with Notepad).

4.    This is how my .htaccess file looked by default

5.    To solve the problem we need to append either of the following codes at the last of the htaccess file

# BEGIN 404 Fix
<IfModule mod_env.c>
SetEnv MODSEC_ENABLE Off
PassEnv MODSEC_ENABLE
</IfModule>
#END 404 Fix

Or

# BEGIN 404 Fix
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterPost Off
</IfModule>
# END 404 Fix

6.    Save the file and upload it again to the same public_html folder after deleting the original htaccess file from there.

7.    It was the second code that solved my problem (as shown).

If you are facing any problem on how to edit the htaccess file then download the file from here and upload it.

htaccess1 (extract and rename to add . and remove 1)

htaccess2 (extract and rename to add . and remove 2)

3 Replies to “[solved] 404 Error After Update or Save Post in WordPress”

  1. Do you have any ideas as to why it started happening? Facing the same problem now and the htaccess tweaks doesn’t appear to be helping..

  2. Wow, Ive been pulling my hair out all morning with this same problem. Found your page and what do you know… it worked! Thank you so much!

Leave a Reply