WordPress.org

Ready to get started?Download WordPress

Forums

404 Redirect to Homepage (2 posts)

  1. Daniel
    Member
    Posted 1 year ago #

    Use the Roots Theme: rootstheme.com, I was digging through the webmaster tools account that I set up for the website and I found out that Google is finding 292 crawl errors. I wanted to try and have all non-existent pages redirect to the homepage to reverse this happening.

    What would be the easiest way to add the below redirect to the 404 pages? It obviously doesn't work by just adding it to the 404.php page.

    <?php wp_redirect(get_option('home')); ?>

  2. Keith Burgie
    Member
    Posted 1 year ago #

    You can do it by adding ErrorDocument 404 /index.php to your .htaccess file.

    However, the second response on this thread (WebmasterWorld.com) suggests that's a horrible idea for SEO. That user recommends customizing your 404 page with an explanation of the problem, a link to your home page, to your sitemap and to major categories.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.