SEO – 301 PHP Redirect to new page or site

I am working on moving one of my old custom CMS site in to WordPress without losing my SEO ranking. The problem is that my old site URL naming convention will no longer exist after importing all of my content in to work press plus the content will now live in a sub-directory as oppose to the home directory.

This is when PHP comes in handy by using a HTTP 301 Redirect. The 301 status code is used to indicate that a page has permanently moved.

Include the following PHP code at the top of each page:

<?php
 
// Permanent redirection
 
header("HTTP/1.1 301 Moved Permanently");
 
header("Location: http://www.dexterityunlimited.com/");
 
exit();
 
?>

You may also like...

Leave a Reply