• Resolved sallymcdonald

    (@sallymcdonald)


    Hey everyone, I’m having a very strange problem at the moment with my 404 page. When I visit a fake subfolder such as:
    https://www.example.com/wordpress/abc/
    It works perfectly.

    When I visit a fake sub-subfolder such as:
    https://www.example.com/wordpress/abc/abc/
    It still works perfectly!

    But if I visit a fake sub-sub-subfolder, (Or anything higher than a sub-sub-sub,) Such as:
    https://www.example.com/abc/abc/abc/
    It only works halfway. My ‘404 Error’ image shows up, but the accompanying text, ‘Sorry, that page wasn’t found.’, doesn’t show up at all, as if the text was never there.

    Everything else works perfectly, the header, the sidebar, the footer … Everything except the text.

    I know this isn’t normal behaviour, so how do I go about fixing it? Here is my 404.php’s code:

    <?php get_header(); ?>
    
    <div id="container">
    
    <div class="imagetitle">
    <img src="https://www.example.com/wordpress/404error.gif" alt="404 Error" title="404 Error" /></div>
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    
    <?php endwhile; ?>
    <?php else : ?>
    <div class="post">
    <h3>Sorry, that page wasn't found.</h3>
    </div>
    <?php endif; ?>
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    
    </div>
    </body>
    </html>
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter sallymcdonald

    (@sallymcdonald)

    Er, anyone have any insight …?

    Thread Starter sallymcdonald

    (@sallymcdonald)

    I’ve discovered something strange … When I switch my permalink structure from /%postname%/ to /%category%/%postname%/, my 404 page works perfectly every time.

    It also works when I use simply /%post_id%/ … Just never when I use /%postname%/ on its own. Very strange.

    Here’s to hoping someone responds.

    Thread Starter sallymcdonald

    (@sallymcdonald)

    I’m just going to bump this. I’ve been working for hours, trying to figure this out on my own … But I’m not having much luck! ??

    Thread Starter sallymcdonald

    (@sallymcdonald)

    If anyone’s willing to help, I’d be about ready to send them a cash reward by now! ??

    Thread Starter sallymcdonald

    (@sallymcdonald)

    Never mind, I figured it out. [No thanks to you guys. :/ ]

    I modified the 404.php page as so, and everything works perfectly now.

    <?php get_header(); ?>
    
    <div id="container">
    
    <div class="imagetitle">
    <img src="https://www.example.com/wordpress/404error.gif" alt="404 Error" title="404 Error" /></div>
    
    <div class="post">
    <h3>Sorry, that page wasn't found.</h3>
    </div>
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    
    </div>
    </body>
    </html>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘404.php — Mysterious Sub-Sub-Subfolder Error.’ is closed to new replies.