WordPress.org

Ready to get started?Download WordPress

Forums

Template 404.php support is borked? (6 posts)

  1. bcat
    Member
    Posted 8 years ago #

    I can't seem to get 404 error pages working with 2.0.1. I've created an example WP installation here for testing. This is a fresh install without any third-party plugins or themes.

    Everything seems to be fine, except for one thing. Invalid URLs, like this one return my theme's index page, not its 404 error page. I can't figure out why this is.

    If it matters, my host is running PHP 5.0.4 and Apache 1.3.34 on Linux.

  2. Waldo Jaquith
    Member
    Posted 8 years ago #

    This discussion keeps coming up, and nobody ever offers solutions. It's very frustrating. I've started using a separate domain for some of my sub-sites, because the new .htaccess approach in WP2 has taken over my domain. There are no more 404s, and .htaccess mod_rewrite calls in subdirectories unrelated to my blog are being ignored.

    I wish there was a plugin to go back to the standard, verbose mod_rewrite calls. Or that, at least, a WP developer would indicate that this is being worked on.

  3. bcat
    Member
    Posted 8 years ago #

    Thanks, but I don't think those threads relate to my issue. I don't want to use an ErrorDocument in my .htaccess file. I just want to get the 404.php file in my WordPress theme to work.

    (And about the old-style rules, have you tried setting the $use_verbose_rules variable in wp-includes/classes.php to true? Maybe this will help you.)

  4. spencerp
    Member
    Posted 8 years ago #

    I'm not sure what can or could be wrong really, mine seems to be working ok here:

    http://vindictivebastard.net/kubrickfixed/contact/

    1) I had just uploaded a blank .htaccess file to the root of the blog. (And gave it a 666 CHMOD setting.)

    2) Adjusted or added my permalink setup I wanted in the Blog's CP => Options => Permalinks

    And then clicked the "Update Permalink Structure" button.

    3) Then went to Manage => Files and selected the ".htaccess (for rewrite rules)" under the Common section to make sure it was there then.

    Didn't have to edit anything in any of the theme files. So hopefully you get this straightened out soon. =)

    spencerp

    On side note, I usually chmod template files 777, ouch ppl might say..but that's just what I do sometimes. =)

  5. Waldo Jaquith
    Member
    Posted 8 years ago #

    bcat, I believe that you're describing the same problem that I'm experiencing, and that is the byproduct of the problem described in the linked threads. Any URL, no matter how ludicrous, yields the index page.

  6. niziol
    Member
    Posted 8 years ago #

    As far as I know, when you are on your WP site, the error 404 document does not come from .htaccess, it comes from WordPress its self, it is not a "real" 404 from the server.

    WordPress will look for a post/page etc matching the requested URI in its DB, using its rewrite functions, if it can't find the requested item, then it will output its 404 page (or it should). bcat, when I look at the headers from the fake page link, the server says '200 OK', as the server is serving the page, but it's WP not doing it's thing.

    It seems everyone finds this problem baffling! Just to rule out, have you made sure your 404.php is correct (ie: with the correct template name in the comments etc.)?

    Good luck,
    Michael.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags