Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Redirect from “not found” to homepage url

Discussion in 'Misc WordPress Requests' started by danielfonda, Nov 29, 2017.

  1. danielfonda

    Guest

    Reply To: Redirect from “not found” to homepage url, by danielfonda

    It depends whether you want to just redirect them to the homepage. Basically there are multiple solutions available.

    1) Use a plugin: https://wordpress.org/plugins/all-404-redirect-to-homepage/
    2) Add a button on your 404 page saying something like “take me home”. The code for the following is as follow:
    <a href="<?php blog_info('url); ?>" class="btn">Take me home</a>
    Note: this code goes into 404.php
    3) Lastly you can use something like the following:
    <?php wp_redirect( home_url() ); exit; ?>
    This will automatically redirect the user to the homepage. (Should also be placed in 404.php)

    Cheers

    Reply To: Redirect from “not found” to homepage url
     
    #1

Share This Page

Web Hosting