Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix 404 when editing a post with hyperlink

Discussion in 'Misc WordPress Requests' started by Michael Nelson, Feb 17, 2018.

  1. Michael Nelson


    404 when editing a post with hyperlink, by Michael Nelson

    This is a doozy, you’ll like it.
    Since about a week ago, when I edit a post, if that post contains a hyperlink (eg <a href="...">...</a>") when I update it, I’m sent to the 404 “Page not Found” page, and the post is NOT saved. Here’s a video: https://drive.google.com/file/d/1OQZ9k5f_jxbxsT4SEyD-pH28FSIMoQlT/view.

    I added some debug code to wp-admin/post.php to see if it’s getting called when the POST request is sent, and it isn’t. The request is somehow going to index.php, and there’s no URL rewrite for that, so it becomes a 404.

    I was suspicious that the plugin “Auto Affiliate Links” was the culprit (https://wordpress.org/plugins/wp-auto-affiliate-links/), because it changes hyperlinks to be affiliate links, and was having some error. But the error still happens when after I’ve deactivated the plugin.

    In fact, I temporarily switched the site to a use a fresh DB (all default settings), with default (twenty seventeen) theme, NO plugins active, and I still get the same problem. However, when I copied the directory containing WordPress’ files to a local copy (running VVV), I did not get the issue.

    So it seems very unlikely that it’s a plugin causing the issue, because the issue persists with all plugins deactivated, and even on a fresh DB (so they couldn’t have changed something in the database). The only way a plugin could be the culprit would be if they changed WP core FILES, right? But if that were the case, I would have expected to reproduce the issue when using those same files on my local VVV site. Right?

    I don’t think it’s a WP configuration issue because I get the same issue on a fresh install of WP.

    I was suspcious that maybe it was a .htaccess issue, but here’s my vanilla htaccess file:

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

    # END WordPress

    Looks pretty regular, right?

    The last possibility, I think, is the hosting company, uniserve (https://www.uniserve.com/) has something running on the webserver that’s intercepting the request for /wp-admin/post.php and instead sending it to /index.php, but only when the post content has a hyperlink in it. Maybe it’s an attempt at blocking some spammers from creating posts with backlinks to their site or something.

    404 when editing a post with hyperlink

Share This Page

Monarch Social Sharing Plugin