• Resolved jesslohm

    (@jesslohm)


    I want all 404’s to go here: https://www.jessicavoiceover.com/404-2/

    I’ve searched everywhere for a solution, but have found nothing.

    My code in 404.php is:

    <?php
    header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: “.get_bloginfo(‘url’));
    exit();
    ?>

    But that directs it to the homepage which is misleading and not helpful to users. I have fumbled with it, eg. replacing url with the actual link I want, but then the page goes blank when it’s a 404…

    There is NO way I want to use a plugin for this either. For one, my homepage is slow enough and second, my attitude is that this should not be that difficult to where I need an extra plugin, my goodness…

    Please help me adjust the code above so that it works. I’m not a php person.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • It would need to be:

    <?php
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: https://www.jessicavoiceover.com/404-2/");
    exit();
    ?>

    Thread Starter jesslohm

    (@jesslohm)

    You’re a lifesaver!!! It works! Thank you!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect 404 to a particular page, NOT the homepage!’ is closed to new replies.