WordPress redirect 404 with 301 to your home

04:43 PM by Christian Koch

Filed under wordpress

Last modified Saturday September 12th, 2015


To redirect 404 error pages via 301, permanently moved to your WordPress home page create or edit the 404.php in your WordPress theme:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>

 

Related Articles

                                                          Leave a Comment