First of all, before jumping onto the wagon and following what others do, you have got to ask yourself why do you want to do it? There are several reasons why people do that, and why people don't. For example, Microsoft redirects microsoft.com to use the www-prefix, Slashdot chooses to use slashdot.org instead of www.slashdot.org whereas Digg allows the use of either digg.com or www.digg.com. Therefore, what is the underlying reason for doing so, or not doing.
Generally, webmasters tend to improve site ranking. A domain name, ie. domain.com, which can be accessible via www.domain.com and domain.com is interpreted as two different sites by the search engine. For example, search for Digg in Google, and you will find that digg.com and www.digg.com exist. Although this improve visibility in search engine, it also has its drawback. Having two sites mean, the ranking of that domain is divided (unequally; dependent on inbound and outbound links) into two. It is fine if the site is highly ranked, and users have no problem discovering the site. However, for sites which do not have very high ranking, it is perhaps more ideal to confine to using one particular domain name for accessing the content.
While a lot of webmasters are highly interested in improving sites' Search Engine Optimization (SEO), Page Rank (PR) and Search Engine Result Page (SERP) for business, others are just happy to create sites for personal use. If you belong to the latter, then it is perhaps not so important to worry about www-prefix on your domain names, unless you feel that it looks nicer with (or without) the www-prefix; otherwise, this article might just be useful for you.
To perform a redirect from domain.com to www.domain.com, insert the following code into your .htaccess file.
# mod_rewrite in use
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
To perform a redirect from www site to non-www site, use the following code in .htaccess file.
# mod_rewrite in use
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^domain\.com
RewriteRule (.*) http://domain.com/$1 [R=301, L]
The .htaccess file is simply a text file with the filename .htaccess, and it should be stored at the root directory of your site.
Note, while using .htaccess file, it is important to use it carefully. Wrongly inserted command may render your site not workable.






























hey just dropping a line to say waht's up. new girl on site and in america...was out of the country for a few years.
hi!