How to make a permanent reditect with php headers
Saturday, November 10th, 2007Hi guys!
With this script you can make a permanent 302 redirection with php headers. This is very usefull when you want to make that google think that your domain.com is the same that www.domain.com.
Here the script:
if ($_SERVER[”HTTP_HOST”] == “www.domain.com”)
-
{
-
Header( "HTTP/1.1 301 Moved Permanently" );
-
Header( "Location: http://domain.com".$_SERVER["REQUEST_URI"]);
-
}
It’s very simple, but very usefull.
Posted in Php, SEO, tip | No Comments »

