May 10 2006

301 redirect using PHP

301 redirect using PHP

If you read my previous post about duplicating your main page, here's a solution about doing a 301 redirect from http://www.yourdomain.com/index.php to http://www.yourdomain.com.

This one is contributed by a friend of mine Benj of actiononline.biz

This is a 301 redirect using PHP program.

<?
$_SERVER[HTTP_HOST] = strtolower($_SERVER[HTTP_HOST]);
if($_SERVER[HTTP_HOST]=="actiononline.biz" or
$_SERVER[REQUEST_URI]=="/index.php") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.actiononline.biz");
exit();
}
?>


2 Comments

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment