WWW to non-WWW to avoid duplicate content problems

Have a linux account and need to know how to avoid duplicate content. I would like to know how to do the following:

1) If I wanted www.mydomain.com to be the way everyone gets to my site how do I make mydomain.com permanently redirect to www.mydomain.com so google only sees one site... not both.

and

2) If I wanted mydomain.com to be the way everyone gets to my site how do I make www.mydomain.com permanently redirec to mydomain.com so google only sees one site... not both.

Thanks in advance!
 
By the way... I notice in the DNS there is an A record for mydomain.com and an A record for *.mydomain.com

I also see in the web service for mydomain.com a server alias called www.mydomain.com.

So with my original questions please describe all changes needed.

Thanks
 
Have a linux account and need to know how to avoid duplicate content. I would like to know how to do the following:

1) If I wanted www.mydomain.com to be the way everyone gets to my site how do I make mydomain.com permanently redirect to www.mydomain.com so google only sees one site... not both.

I found one site that said to use an .htaccess file with the following:

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

Is this correct for the mydomain.com to www.mydomain.com?

If so do I remove the server alias www.mydomain.com from the web service?

Thanks
 
Back
Top