WordPress.org

Ready to get started?Download WordPress

Forums

404 redirect to index.php (6 posts)

  1. 2bak860
    Member
    Posted 8 years ago #

    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,

  2. sumeetjain
    Member
    Posted 8 years ago #

    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;
    ?>

  3. BoInG
    Member
    Posted 8 years ago #

    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...

  4. sumeetjain
    Member
    Posted 8 years ago #

    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.

  5. 2bak860
    Member
    Posted 8 years ago #

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

  6. MindReality
    Member
    Posted 7 years ago #

    "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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.