PHP 301 Permanent Redirect

After starting this site, it came time to shut down the predecessor. But, my other site had at least some authority/PR that I wanted to pass along. So I sat down to figure out how 301 redirecting worked. And, it’s some really simple PHP code.

Here is a sample redirect:

<?php
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.new-domain.com/new-folder/new-page.html”);
exit();
?>

That’s it!

Posted: August 13, 2007  | Under: Code

Comments

Leave a Reply