WordPress.org

Ready to get started?Download WordPress

Forums

404 Error after edit -> Update Post (26 posts)

  1. Jo0Lz
    Member
    Posted 5 years ago #

    Hi everyone!

    I've had this problem, ever since I installed 2.7 RC1.
    Whenever I edit an existing post, save some tags, make some adjustments to the post, etc. And then click "Update Post", I get a 404 not found error.

    I get redirected, after pressing "save" and the url generated is something like this:
    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"

    This generates the 404. The post is there, I can view it in the list, and as a single post just fine. Any ideas as to what's causing this?

    Thanks.

  2. Jo0Lz
    Member
    Posted 5 years ago #

    I just tested to see if this was a template fault, but it seems that even with the default theme this error occurs.
    I've adjusted permalink structure, set it to default, but that doesn't matter either. The 404 error persists.

    I'm going to update another blog, hope that the error won't appear there... If it doesn't, it still is going to be a pain to find out what is causing it. Weird because I haven't seen any forum posts on this, so it might be just me having this error.

  3. Jo0Lz
    Member
    Posted 5 years ago #

    No-one with the exact same problem?

    I'm going to install a test wordpress (development server) to see if it's related to my site.

  4. iSimone
    Member
    Posted 5 years ago #

    I don't get the 404 error, though I'm redirected to white pages. It's a pity. This problem and the feed problem make it a bit painful.

  5. Jo0Lz
    Member
    Posted 5 years ago #

    I've just tested this on a clean install of 2.7, and after pressing "Update Post" I get redirected to the edit page. So, the problem might be related to updated install's of wordpress...

    I'll be upgrading some other blogs this week, going to see if they have the same problem. If so, I might try a clean install, and importing everything into that install.

  6. procdaddy
    Member
    Posted 5 years ago #

    same exact thing is happening to me, i had installed RC2 and it has happened ever since.

  7. Hanenwurger
    Member
    Posted 5 years ago #

    Same here... It's been doing that for a long while now. Quite irritating.

    <i>Quick edit</i> works fine though.

  8. Jo0Lz
    Member
    Posted 5 years ago #

    Okay, I found out the piece of URI produced by pressing the "update post" button, that doesn't work, but do not yet know how to fix it.

    The URI that I get redirected to:
    http://mysite.x/wp-admin/post.php?action=edit&post=27&_wp_original_http_referer=http%3A%2F%2Fmysite.x%2Fwp-admin%2Fedit.php&message=1

    The URI that works:
    http://mysite.x/wp-admin/post.php?action=edit&post=27&_wp_original_http_referer=http%3A%2F%2Fmysite.x%2Fwp-admin%2Fedit.php

    But it doesn't show the "Post updated. Continue editing below or "go back" message, which I figure is added by the &message=1 ...

    Going to digg into this.

  9. Hanenwurger
    Member
    Posted 5 years ago #

    Cheers man, keep us posted!

  10. Jo0Lz
    Member
    Posted 5 years ago #

    Ok, weird thing. I've posted a "happy new year" blog post.
    I can update that post fine, it returns to the edit screen, with the message "post updated".

    But, a post about christmas presents, still gives me the 404 after updating... :D

    Navigating away from the admin panel, and moving back in, editing the same "happy new year" post, again gives me that 404 error.

    In the case of error 404, it redirects to message=1, but earlier it was redirecting to message=6...

    I'm at a loss here...

  11. Hanenwurger
    Member
    Posted 5 years ago #

    This looks similar...

  12. Hanenwurger
    Member
    Posted 5 years ago #

    It doesn't have anything to do with activated plug-in's either, eventhough the avatar plug-in suffers from this issue.

  13. Daniel Bachhuber
    Hand Built
    Posted 5 years ago #

    I've got the same problem on two instances of WordPress, although they're exhibiting different behavior. On my personal site, I only get "Error 500" right after I publish a post and when I try to delete a post. On an organizational site, I get "Error 500" on every URL including /wp-admin/. That problem occurred when I tried to reactivate the plugins after a manual upgrade.

  14. Jo0Lz
    Member
    Posted 5 years ago #

    Okay, I've found a fix, but I'm no server expert, so I don't know if I just created a security issue, but here goes.

    I've been having this problem for a while now, and I am convinced that it's a server configuration issue. This is because on my home server and several other WordPress installation, this error does not occur. It's strange however, that this problem only arises after installing WP 2.7.

    There are a few changes I made to the .htaccess file, in order to find a solution by using a "trial and error" method. (Thanks Hanewurger, your post helped me out A LOT!)

    Here's what I added to the .htaccess file:

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

    The original (WordPress generated) .htaccess looked like this:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    So, after my edit, the .htaccess looks like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # BEGIN 404 Fix
    
    <IfModule mod_env.c>
    SetEnv MODSEC_ENABLE Off
    PassEnv MODSEC_ENABLE
    </IfModule>
    
    #END 404 Fix

    The 404 errors after updating posts are now solved. However, I'm not an expert, but why does this happen, and why do I have to make this adjustment? I wonder if this causes any security problems on my domain... Is there anyone who can shed some light on this issue?

    @Hanewurger, maybe you can try this solution and see if that Avatar Plug-in issue is solved as well?

    @Danielbachhuber, in the link that Hanewurger provided is some information on other possible solutions. You might want to try them out, because the post was really there to help solve "Error 500" issues.

    Hope anyone is helped by this, and I hope someone can shed some light on the security questions ;)

    Regards,
    Jo0Lz.

  15. Hanenwurger
    Member
    Posted 5 years ago #

    Unfortunately the .htaccess modifications didn't work for me, same goes for the avatar-plugin.

    From what I heard, modifying the .htaccess file can solve a lot of issues, but it's advised to leave this file as it is. It did solve some of the WP-issues I had before 2.7, but it seems like the bugs got resistant now :)

    I'm sure your method will help a lot of users struggling with this issue, but as you mentionned: answers from WP-experts might give a fully waterproof solution.

    Eitherway, thanks for the time and energy you've put in this fix - I think it will help most of the people out who are landing on this page.

  16. Hanenwurger
    Member
    Posted 5 years ago #

    Editing a comment works fine, unlike the post.

  17. jonathanlimusic
    Member
    Posted 5 years ago #

    editing the .htaccess file didn't work for me either

  18. jonathanlimusic
    Member
    Posted 5 years ago #

    editing the .htaccess file didn't work for me either

  19. Jo0Lz
    Member
    Posted 5 years ago #

    You can try putting in the following code

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

    instead of

    # BEGIN 404 Fix
    
    <IfModule mod_env.c>
    SetEnv MODSEC_ENABLE Off
    PassEnv MODSEC_ENABLE
    </IfModule>
    
    # END 404 Fix
  20. novada
    Member
    Posted 5 years ago #

    I stumbled across the same problem after moving to a host that uses Mod Security. In my case my post was triggering a SQL Injection attack warning so Mod Security was 404 redirecting the request.

    Mod Security was concerned because my post contained the word "select" followed by the word "from". It did not seem to care that these words were 2 paragraphs apart?

    Has WordPress worked with Mod Security on this issue and do they have any recommendations? Is disabling Mod Security the best option. If so should it be done in the directory that WordPress is installed in or should it be done just in the /wp-admin directory? I would hope that WordPress does not have any SQL Injection vulnerabilities. If so is it safe to tell Mod Security to not worry about POSTS/GETS to /wp-admin/page.php

  21. Hanenwurger
    Member
    Posted 5 years ago #

    Thanks for that, novada. Sheds a very clear light on the matter.

    Ok, Jo0lz, let's do that then. Thanks.

  22. PressClick
    Member
    Posted 5 years ago #

    This is the solution that worked for me:

    Upload an .htaccess with the following 2 lines:

    SecFilterEngine Off
    SecFilterScanPOST Off
  23. tvdsluijs
    Member
    Posted 5 years ago #

    This

    SecFilterEngine Off
    SecFilterScanPOST Off

    Works for me to !

  24. shubhamoy
    Member
    Posted 4 years ago #

    @ Jo0lz
    I'm facing exactly the same problem and applied the fix suggested by you but everything was in vain since I'm still getting 404 page on posting an article.

  25. cyberfrogz
    Member
    Posted 4 years ago #

    SecFilterEngine Off
    SecFilterScanPOST Off

    It's works for me...,thanks alot dude...

  26. atimoda
    Member
    Posted 4 years ago #

    None of these solutions works for me, but i think my problem is the same: http://wordpress.org/support/topic/329309

Topic Closed

This topic has been closed to new replies.

About this Topic