A lot of SEO experts say that if you allow people to go to either domain.com or www.domain.com the search engines will index both URLs as if they are two totally different sites. You might think that is bad news, but what ends up happening is the search engines will see the same content (duplicate) on both domain.com and www.domain.com and the search engines will demote your listing for having duplicate content on more than one domain.
The way to fix this is to either permanently redirect all traffic from domain.com to www.domain.com, or vice-verse. If you’re using Apache there is a quick and easy way by using .htaccess files. To redirect all domain.com to www.domain.com, you can do the following:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Or if you want all www.domain.com to forward to domain.com, use this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
