Support » Fixing WordPress » NO 404 page. Whatever address you type in WP2.0

  • crackdown


    I have upgraded to WP 2.0 and I’m getting this weird error: you can type any kind of address / pagename that if it does not exist my blog will just return to the home… not giving you a 404 page.

    working home

    random link that does not exist
    it will point you to the homepage instead of showing a 404 page.

    My blog is in a subfolder: and I just updated the permalinks structure. Don’t know what is causing the issue. Any idea?


Viewing 13 replies - 1 through 13 (of 13 total)
  • Damage


    Any luck figuring out the issue Nicco? I’m having the same problem. If you look, the permalinks structure has changed a lot with the new release. I think it has something to do with this, but, can’t figure out the problem.



    Wait, is this a BAD thing? I mean, all it means is that users dont get lost when they visit an invalid page…



    Reversial, some people have custom 404 pages that they like to show. (:

    crackdown, just to clarify are you saying you have a file named 404.php in your current theme’s folder, and it still doesn’t show? If there isn’t a 404.php file, you can expect the behavior you describe.



    Exact same problem here on my WP2.0 test site. I have a 404.php file but it’s not used. This is one of the reasons I haven’t upgraded yet. Has anyone been able to fix this?



    I had to create a 404.php file and add ErrorDocument 404 /index.php?error=404 to my .htaccess file. I found the Codex article on creating custom 404 pages useful.



    I believe the problem is related to how WP2.0 handles the permalink structure and/or how the .htaccess file is now setup. I have a more detailed description of the problem here:



    I’ve been having the same problem.

    I already have ErrorDocument 404 /404.phtml in my root .htaccess, I prefer error pages to not be handled by WordPress.

    I’m assuming I can revert to my old .htaccess setup, that only redirected specific bits of the site into WordPress? Specifically, anything that doesn’t begin with “/archives” is none of WordPress’s business.



    You can have your .htaccess handle such errors:

    ErrorDocument 404

    Then make a separate error page and upload it.



    Mine used to also direct to the homepage when I type in a URL that don’t exist. But after I’ve made a custom 404 page and upload it into my theme folder. Whenever I type in a URL that don’t exist, the 404 page turns up. It’s working in wp 2.0 and I didn’t edit the .htaccess file at all. 🙂

    I think the problem is that the ErrorDocument handler in .htaccess isn’t getting the chance to do anything because WordPress handles the problem.

    Because WordPress is handling it Apache is not aware that there was a 404 error.

    The root cause is that WordPress’s permalink lines in .htaccess are accepting too much, they should be more specific.

    If you look in the source code for wp-include/classes.php at line 864 it has:
    var $use_verbose_rules = false;

    If you change the line to:
    var $use_verbose_rules = true;

    You get the old-style more specific rewrite rules. I’ve tried this on my site and it works, it may cause problems with plugins (such as Owen Winkler’s EzStatic) that depend on the less-specific rules but you can manually write rewrite rules to get around that.

    This makes sense and I expected this to also fix the problem on my site. But it didn’t. I think it’s because of my particular permalink structure: /%category%/%author%/%postname%/

    I think setting var $use_verbose_rules = true; helps with the troubleshooting though. In the new verbose .htaccess file, I see:

    RewriteRule ^(.+)/?$ /index.php?category_name=$1 [QSA,L]

    I see the exact same line on my WP1.5.2 site’s .htaccess file where I use the exact same permalink structure. So, it seems that querying a non-existent category in WP1.5.2 correctly returns a 404. However, on WP2.0 it doesn’t. Surely, this is a bug.

    Next, I need to figure out how to fix this. Or at least, find a way to make the powers at be take notice.


    Arrgh! It’s a known issue!

    I implemented the fix and now it’s fine. I should really learn to check for known bugs first!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘NO 404 page. Whatever address you type in WP2.0’ is closed to new replies.