WordPress.org

Ready to get started?Download WordPress

Forums

404 page does not view on next level down child pages. (17 posts)

  1. laptophobo
    Member
    Posted 2 years ago #

    I just noticed that if I go to a bad URL that is the 3rd level or lower of the parent page, the 404 page does not come up. Instead it views the last post created. Below are examples.

    If I enter either of these (broken/bad) URLs, they will go to 404 "Page not found" page -- which is what it's supposed to do.

    http://website.com/oops
    http://website.com/america/oops

    But, if I go any level deeper, I don't get the 404 page.

    http://website.com/america/california/oops
    http://website.com/america/california/chicago/oops

    My guess is that the 404 mechanism isn't written to go beyond the next level child page? Any ideas how to correct this so that 404 works on all child pages?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Can you replicate this using Twenty Eleven with all plugins deactivated?

  3. laptophobo
    Member
    Posted 2 years ago #

    Hi Esmi. I don't use Twenty Eleven. And I just tried deactivating the plugins to see if that changed anything. Nope.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Can you replicate this when you use Twenty Eleven?

  5. laptophobo
    Member
    Posted 2 years ago #

    I just tried it in Twenty Eleven. The problem does not exist in this template.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    Then it would seem to be a problem within your current theme.

  7. laptophobo
    Member
    Posted 2 years ago #

    Yup, that would appear so.

    Maybe there's a theme expert out there who knows a work-around? Anybody?

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    So far, you haven't even given us the url of your site so we can see your current theme. We're good but we're not psychic. ;-)

  9. laptophobo
    Member
    Posted 2 years ago #

    Yes, you've located the solution -- when you suggested that I select "default" in the permalinks settings. I found that if I select anything other than "post name" in Permalinks, the problem stops. So, play around with the permalinks options and the problem goes away.

    Thanks again for your help Esmi.

  10. hasnat
    Member
    Posted 2 years ago #

    How can i change my admin log-in url setting by ftp for My site?

  11. esmi
    Forum Moderator
    Posted 2 years ago #

    @hasnat: It is considered impolite to interrupt another poster's thread. Please stick to your own topic.

    @laptophobo: That's still a little weird. The post name permalink option was only added in 3.3. I wonder if you've hit a server config issue? Going to see if I can get some more eyes on this.

  12. laptophobo
    Member
    Posted 2 years ago #

    I sent the author of the theme an email about the issue. Hopefully he can shed some light on the subject. Thanks for taking an interest in this though.

  13. esmi
    Forum Moderator
    Posted 2 years ago #

    Are you using any custom page templates? Does the theme use any custom queries - either in page.php or functions.php? If the theme author is doing something funky with queries, this could be having a knock on effect on your 404s.

  14. laptophobo
    Member
    Posted 2 years ago #

    The pages, per example at the top of this thread, were all part of a custom page. And the original Theme was created before the version 3.3 option for "post name." So, this might be why. Anyway, as long as I stay away from choosing "post name" for permalinks, it's working.

  15. esmi
    Forum Moderator
    Posted 2 years ago #

    The pages, per example at the top of this thread, were all part of a custom page.

    What happens if you just use the default page.php template? I'm really curious as to why that specific permalink structure isn't working, Nornmally it's either all of the present custom structures work or none of them do (because mod_rewrite isn't running or the .htaccess isn't being updated). I've not seen just 1 preset fail before and the fact that it's the newest makes it worthy of a bit more digging.

    Added to which, the precise permalink structure should not affect Pages - only Posts. Which makes this even weirder.

  16. laptophobo
    Member
    Posted 2 years ago #

    The same problem occurs even on default page.php template.
    As for why this problem affects pages and not posts is indeed weird.

  17. esmi
    Forum Moderator
    Posted 2 years ago #

    Got someone else to have a look at this and the consensus of opinion is that there is indeed something funky going on with the Loop or the standard $query in that theme. It might be in the 404.php file itself but it could also be in functions.php, header.php or any/all of the page templates.

Topic Closed

This topic has been closed to new replies.

About this Topic