Home > Featured > WordPress site redirect missing pages to the homepage
Bookmark and Share

WordPress site redirect missing pages to the homepage

Posted on September 02, 2012 | Filed in Featured, Wordpress

If you are using WordPress and have updated a website, chances are that many links from your older site are outdated.
There is a simple way to avoid showing visitors a 404 page.

Just create a file called 404.php and upload it to your active theme folder. This file will make WordPress produce a 301 redirect to the homepage or any other URL you may like for all missing URLs on the site.

<?php
header(“Status: 301 Moved Permanently”);
header(“Location:http://www.abc.com”);
?>

Leave a Reply

Contact Us

Big Apple Design Group
134 West 29th Street
Third Floor
New York, NY 10001

[email protected]

Search Blog