Support » Fixing WordPress » 404 redirection

  • shadow


    I am trying to sort out my 404 stuff.

    I would like to make it so that visitors who end up at a 404 are redirected to a message contained within the site itself.

    For instance, going to
    no longer works.

    So how do I redirect the visitor using my 404.php and 404.shtml to a page which has the header, sidebar and footer and a message telling them to go elsewhere?

    It is half happening here

    but obviously it is not right yet…

    Thanks for any advice you can offer 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • Kafkaesqui




    Thanks for the link kafkaesqui but the main reason I am having to do this is because I am having trouble writing to my .htaccess.

    Is there another way of doing this not using .htaccess ?



    If you have access to your server’s .conf file…

    Seriously, one way you may be able to this (and still point to the proper theme) is to treat the 404.php in your root as a non-themed but still WP template file by adding this at the top:

    define('WP_USE_THEMES', false);

    Then to call the various template includes (header, footer, etc) for the active theme, use this format:

    <?php load_template( TEMPLATEPATH . '/header.php'); ?>



    Actually, not thinking deep enough tonight. get_header(), get_footer() and so on will continue to work. So no need for the slightly longer version above.



    Thanks Kafkaesqui 🙂

    I think I may have found an easier solution though.

    Any error pages are directed to my 404.shtml so I have added a quick redirect script there and linked that to a simple error announcement on a static page.

    It seems to work.

    Have a look…

    Thanks again for your help 🙂

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