• Resolved dtris13

    (@dtris13)


    I created a 404.php but it doesn’t seem to be called into use if I deliberately put a mistake in the url. No matter what, it displays index.php instead.

    For example, if I enter http://www.mysite.com/whatever, it shows index.php rather than the 404.php.

    Any suggestions?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you looked at the WordPress directions for 404 pages yet?

    http://codex.wordpress.org/Creating_an_Error_404_Page#Creating_an_Error_404_Page

    The easiest way to do this is to copy the 404 page from the twentyten theme into your own theme and then modify the error message to whatever you want to say.

    Thread Starter dtris13

    (@dtris13)

    Yes. I created a very simple 404.php page and placed it in with my other theme files. But it gets ignored.

    Awesome. So the next step is to try doing the follow:

    Open up 404.php and replace this:

    <?php get_header(); ?>

    With this:

    <?php
    
    header("HTTP/1.1 404 Not Found");
    header("Status: 404 Not Found");
    
    get_header(); ?>

    If that doesn’t do anything then try adding the following to your .htaccess file:

    ErrorDocument 404 /index.php?error=404

    The url /index.php is root-relative, which means that the forward slash begins with the root folder of your site. If WordPress is in a subfolder or subdirectory of your site’s root folder named ‘mysubdirectory’, the line you add to your .htaccess file might be:

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

    source: http://codex.wordpress.org/Creating_an_Error_404_Page#Help_Your_Server_Find_the_404_Page

    Thread Starter dtris13

    (@dtris13)

    I’ve tried all of the above. Thanks.
    Nothing works.
    Very odd…. It’s a relatively simple thing. But for some reason, 404 page never shows up.

    Thread Starter dtris13

    (@dtris13)

    Resolved.
    All, in case anyone wants to know, the above suggestions do work. And in most cases, not all of that is necessary.

    I fixed my issue and it was just a very minor error in my own code. Had nothing to do with the above.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘404 page not showing up’ is closed to new replies.