Redirecting www.example.com to example.com (or vice versa)

For search engines like Google, it's best to redirect all websites or domains to one location. This concentrates the visitors to one URL. The Page Rank (a Google term) will not be divides amongst all these different URLs, but concentrated to one.

One trick you can do is edit the .htaccess file in your Drupal installation. The file itself describes how to redirect, I could setup this for the domain example.com:

  RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

If you have several domain, you need to add a whole lot of lines, think about it carefully, or have somebody think about it for you.

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning robert@meinit.nl