• Hi!

    I set up a main page that has some subpages. And some of these have also subpages. But if I visit those subsubpages I get a 404. But when I change this subsubpage into a subpage, the 404 is gone.

    website.com/mainpage/subpage/subsubpage

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    What happens if you requested website.com/subsubpage/? Expected result is the page in question is shown and the browser address field is rewritten to website.com/mainpage/subpage/subsubpage/

    Your site’s permalink setting is just /%postname%/, right?

    This 404 you get is the WordPress themed nothing found sort and not a generic, plain server 404 page, correct? If so, the related query for the page has somehow failed. Install and activate the Query Monitor plugin. After requesting the subsubpage, filter the queries in the monitor for caller get_page_by_path().

    The query should find 3 rows. The data returned is used to determine the ID of subsubpage, which is used in the main query to get the page. If 3 rows were not found, there’s something off with the query made, like additional, unneeded conditions that cannot be met. Any such unneeded conditions could be a clue to the root cause. The query should be something like

    SELECT ID, post_name, post_parent, post_type
    FROM wp_posts
    WHERE post_name IN ('mainpage','subpage','subsubpage')
    AND post_type IN ('page','attachment')
    Thread Starter teclub

    (@teclub)

    Yes, it’s all /%postname%/. They used to work. But somehow they stopped working.

    The 404 page is a the custom one I made.

    Installed the plugin, but it couldn’t find the part.

    Tried out some stuf, and it looks like there is a problem with the particular mainpage. I have some other pages with the same path ‘length’, and that path doesn’t have the problems.

    Thread Starter teclub

    (@teclub)

    Just deleted the corrupt mainpage. Seems like everything is working allright again.

    Thread Starter teclub

    (@teclub)

    Back again. Now all of my subsubpages get a 404 error when I try to visit them…

    Tried the Query Monitor plugin and tried to find the named part, but that doesn’t show.

    Thread Starter teclub

    (@teclub)

    Build another website, but the same problem turned up. I build the website with the subsubpages, worked fine untill last week. When I build the same setup with new pages, it’ll work. But when I rename them, and the slug, to the pages I want, the subsubpage shows a 404.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘404 on subsub page’ is closed to new replies.