WordPress.org

Ready to get started?Download WordPress

Forums

NO 404 page. Whatever address you type in WP2.0 (14 posts)

  1. crackdown
    Member
    Posted 8 years ago #

    Hi
    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.

    examples:
    working home
    http://www.flipthedolphin.com

    random link that does not exist
    http://www.flipthedolphin.com/asdfhjklqwr/
    it will point you to the homepage instead of showing a 404 page.

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

    Thanks
    Nicco

  2. Damage
    Member
    Posted 8 years ago #

    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.

  3. reversial
    Member
    Posted 8 years ago #

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

  4. Brigitte
    Member
    Posted 8 years ago #

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

  5. Austin Matzko
    Member
    Posted 8 years ago #

    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.

  6. Aylwin
    Member
    Posted 8 years ago #

    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?

  7. dumpendebat
    Member
    Posted 8 years ago #

    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.

  8. Aylwin
    Member
    Posted 8 years ago #

    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: http://wordpress.org/support/topic/56559

  9. kevin_i_orourke
    Member
    Posted 8 years ago #

    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.

  10. DianeV
    Member
    Posted 8 years ago #

    You can have your .htaccess handle such errors:

    ErrorDocument 404 http://site.com/somepage.html

    Then make a separate error page and upload it.

  11. Truth
    Member
    Posted 8 years ago #

    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. :)

  12. kevin_i_orourke
    Member
    Posted 8 years ago #

    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.

  13. kevin_i_orourke
    Member
    Posted 8 years ago #

    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.

  14. Aylwin
    Member
    Posted 8 years ago #

    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.

    EDIT:

    Arrgh! It's a known issue!

    http://trac.wordpress.org/ticket/2123

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags