Back in the early days of the World Wide Web, everything had a symbolic link to point it to the correct location, for instance you would access ftp.domain.com to access the FTP server, you would access mail.domain.com to access the Mail server, you would access telnet.domain.com to access the Telnet server and so on. So when the World Wide Web came about, naturally people decided that hey, it should have www.domain.com to make it easy for people to remember how to get to the hypertext documents.
So now, years later, we still use www even though it isn't really necessary as it is a sub-domain which points back to domain.com actually causing more load time for your site. Now if you can access www.domain.com and domain.com and both are valid, chances are you will be fracturing your SEO because some links point to domain.com and some point to www.domain.com when pointing to your site and the spider sees them as two separate websites.
So, how can we fix this? Well, you can tell everyone to link one over the other but that really doesn't work for those inbound links you don't know about until after the fact or... you can redirect one to the other.
First step of course is to create a .htaccess file if you don't already have one and add one of the following bits of code...
#Redirect all queries to www.domain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
#Redirect all queries to domain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.net$ [NC]
RewriteRule ^(.*)$ http://domain.net/$1 [R=301,L]
Now if you're just starting the site, you have some time to make the decision as to which you prefer, in my case, I found one of my sites had a much higher pagerank on the www even though I prefer non-www so I chose to redirect all traffic for that site to the www address.
Second step is to get a
Google Webmasters Tools to control how Googlebot interacts and lists your site, you can set the new preference for your listing there.
Third, when you share your link with others or if you use the full address in your site, always, ALWAYS use the way that you chose, if it's non-www then domain.com, if you chose www then www.domain.com to ensure your site link once crawled points to the address you're trying to build Pagerank on.
LinksWhat's My Pagerank?Google Webmasters Tools