Support » Themes and Templates » 404 redirect to index.php

  • Hi!

    How can I customize the:

    <?php endwhile; else: ?>
    <div class=”warning”>
    <?php _e(‘Sorry, no posts matched your criteria, please try and search again.’); ?>
    </div>
    <?php endif; ?>

    So that instead of bringing up that message, the user just gets redirected to the index page?

    I’m using the greenmarinee theme if that helps.

    thanks,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Remove the inlcude for the header from your error page template file. Then stick this where that was:

    <?php header("Location: http://www.yourblogindex.com/");
    exit;
    ?>

    My advice is that you will use the 404 page – helps users to know if the page they are searching for it is/or not still avaible.

    You can use in the 404 template the search box – helping the users that are visiting your site to find what they are looking for.

    just my point of view…

    I agree with boing. Unless you have a great reason to redirect them to the home page, it’s contrary to usability to not give them a 404 page. Tell them some possible causes of the error, some advice on how to resolve the issue, and provide a search box – perhaps filled in with the tail of their requested path.

    Well it’s a one page site you see. Normally I would use the 404 page, but there seems no point.

    “provide a search box – perhaps filled in with the tail of their requested path”

    How do you do something like that? Inform me at http://mindreality.com/contact.html

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