[wp-trac] [WordPress Trac] #10191: WordPress not determining if a request is a 404

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 6 19:10:45 UTC 2009


#10191: WordPress not determining if a request is a 404
--------------------------+-------------------------------------------------
 Reporter:  sivel         |       Owner:  ryan
     Type:  defect (bug)  |      Status:  new 
 Priority:  normal        |   Milestone:  2.9 
Component:  Permalinks    |     Version:  2.8 
 Severity:  normal        |    Keywords:      
--------------------------+-------------------------------------------------

Comment(by janeforshort):

 To close the dupe at 10486, pasting in dcole07's notes from that ticket
 here:

 "There is something wrong with how WordPress desides whether to use the
 404 template or not. There are a lot of cases where it uses other
 templates went there is not content.

 How to reproduce: Install Wordpress 2.8.X Use the Default theme Go to
 ?p=404 or any made up page that isn't real. It doesn't go to the 404
 template, which it should. It instead uses the single template, even
 though there is no content.

 Themes can do a work-a-around by using an if/else statement and checking
 for content, but that's dumb, when we have a is_404() check. WordPress
 should default to using 404.php (if there is one) and make is_404() true
 before any template file is loaded.

 If this is how the core developers want the 404 to work, then another
 template and template functions should be made, so people can have one
 template to manage URLs that don't have content."

 "To summarize this problem, WordPress is able to find a template based on
 URL information, but it turns out to be the wrong template, because there
 is not content."

 "I'll pick up this ticket or the one it's a dup of, if no one else will
 and someone is willing to mentor me or give feedback to my ideas. I'd like
 to suggest a solution, but I don't know enough about the WordPress
 template system at the moment... I'll look into it."

 "I read though the WordPress code and it's not like the code has a bug,
 it's just lacking the feature to pickup on missing content. The problem
 with generating a solution for this "bug" is that we don't know there is
 no content until we're half way though the template it did match. What I
 don't get, is that this problem can be avoided with the right non-default
 permalink structure. So, does that mean we can patch this problem, so
 visitors don't use a template that doesn't have content available? I'm
 thinking we could check for content based on what the URL says it's going
 to be when WordPress is deciding what template to use and give a 404 if
 nothing is found... basically. We'd have to be careful, because some
 templates may be designed to not have content."

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10191#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list