How to make a permanent reditect with php headers
November 10th, 2007
Hi 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.


Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed