doingword.com

Archive for the ‘SEO’ Category

How to make a permanent reditect with php headers

Saturday, 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”)
  1. {
  2. Header( "HTTP/1.1 301 Moved Permanently" );
  3. Header( "Location: http://domain.com".$_SERVER["REQUEST_URI"]);
  4. }

It’s very simple, but very usefull.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Php, SEO, tip | No Comments »