• shadow

    (@shadow)


    Hi,
    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 http://shadows.os42.com/2005/03/25/its-not-going-to-be-easy-people/
    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
    http://shadows.os42.com/404.php

    but obviously it is not right yet…

    Thanks for any advice you can offer 🙂

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

    (@kafkaesqui)

    Thread Starter shadow

    (@shadow)

    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 ?

    Kafkaesqui

    (@kafkaesqui)

    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:

    <?php
    define('WP_USE_THEMES', false);
    require(./wp/wp-blog-header.php');
    ?>

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

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

    Kafkaesqui

    (@kafkaesqui)

    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.

    Thread Starter shadow

    (@shadow)

    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…

    http://shadows.os42.com/this-page-will-not-work

    Thanks again for your help 🙂

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