WordPress.org

Ready to get started?Download WordPress

Forums

WP 1.5: 404.php not being called (8 posts)

  1. ironman_jakarta
    Member
    Posted 9 years ago #

    I put a 404.php in my theme folder but it's not being called. I juts get my index page with this text:

    Not Found
    Sorry, but you are looking for something that isn't here.

  2. Have you set the 404.php file as your custom 404 error page via .htaccess?

    If not, access the .htaccess file in your site's main directory and enter the following (adjust the path to fit your installation):

    ErrorDocument 404 /wordpress/index.php?error=404

  3. HeavenlyEvil
    Member
    Posted 8 years ago #

    My theme has a 404.php file, and I put ErrorDocument 404 /wordpress/index.php?error=404 in my .htaccess file. On both my live server and the local one it calls the 404 page, but without any of the styles.

    What am I doing wrong?

  4. ifelse
    Member
    Posted 8 years ago #

    At the top of your 404.php file, you're missing a call to <?php get_header(); ?>

  5. HeavenlyEvil
    Member
    Posted 8 years ago #

    That's the first line of my 404.php file, and my Google Ads show up so it's calling the header at that point, at least.

    Anything else?

  6. HeavenlyEvil
    Member
    Posted 8 years ago #

    From what I can tell, it's a problem with one of the other theme files. I based my theme off the Connections theme from the themes directory, and the 404 page doesn't seem to work for that theme either.

    I've no problem fixing the theme, I just need to know where to look for a problem like this.

    Edit: I've replaced the files one-by-one and my header.php file seems to be the culprit. I'm trying to find out why.

  7. HeavenlyEvil
    Member
    Posted 8 years ago #

    My header.php for kathy.deanomac.com contains the following code: <div id="header">
    <ul id="topnav">
    <script type="text/javascript">GOOGLE ADS HERE
    </script> </a></li>
    </ul>
    <h1><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
    <div id="desc"><?php bloginfo('description');?></div>
    </div>
    .

    For deanomac.com it says: <div id="header">
    <h1><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
    <div id="desc"><?php bloginfo('description');?></div>
    </div>
    .

    Neither of them work with the 404 page. It does work for the default theme, which has a significantly more complicated header.php file. Is there something I need to add to mine to make the 404 page accept it?

  8. HeavenlyEvil
    Member
    Posted 8 years ago #

    Okay, I've tested that as well and it makes no difference. The error page displays the header content, so it's not that either.

    Basically, it's not recognizing the stylesheet. What would cause that?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags