Redirecting to the "www" Version of Your Domain
For search engine optimization (SEO) you may need to redirect
the non-www version of your domain to the www version. In other
words, you want to force all traffic to your site at
www.yourdomain.com instead of allowing people to visit
Their are two main benefits to doing this.
- Prevent duplicate content within search engines: A search
engine might see
www.yourdomain.comas two separate websites and penalize you for having identical content in two places, when in reality they're the same site.
- Avoid splitting analytics data: If some visitors are going to
yourdomain.comand others are going to
www.yourdomain.com, it's possible that your analytics software may track those visitors separately.
There are myriad resources online which explain how to resolve this problem. Here is a sample search on Google that provide links to multiple articles: http://www.google.com/search?q=htaccess+301+redirect+www
If you are on an Apache web server, here is a sample .htaccess file that you can place in your website's root folder. Note that you'll need to rename this file to .htaccess before it will work.