Got Chance

www or no www in domain names

WWW or No WWW in Domain Names

September 14, 2007 by Hari

This is something simple that all blogs can do and all blogs should do, but not all blogs do. Do you know that and are treated by search engines as two different websites. So, the search engine results may split up and even worse the Google PageRank will split too. So, it is generally a good practice to do a Search-Engine-Friendly redirect from on to the other.

Here i have chosen to redirect to But that doesn’t make any difference. Here’s how to do it. Just add the following code to your .htaccess file in the root directory of your domain :

Options +FollowSymlinks

RewriteEngine on

rewritecond %{http_host} ^ [nc]

rewriterule ^(.*)$$1 [r=301,nc]

If you want to do it otherwise (i.e) from Non-WWW to WWW, here’s the code :

Options +FollowSymlinks

RewriteEngine on

rewritecond %{http_host} ^ [nc]

rewriterule ^(.*)$$1 [r=301,nc]

Now, go ahead and start concentrating your SE Optimization on one domain.

UPDATE : When i checked the FeedBurner stats (while making this post), i noticed something that is very much related to this post. Here is a screenshot. I use for my FeedBurner feed and shows as one of the top referrers. This is before i started redirecting www to non-www :

If you’re new here, you may want to subscribe to our RSS feed. Thanks.

Posted in SE Optimization, Web Development.

12 Responses to “WWW or No WWW in Domain Names”

Trackback URL
Feed for this entry



I have been quite concerned about this issue as well. May I ask how I can do the re-directing from WWW to the non-WWW address on Blogger? (I am using the new version.)

Thank you very much in advance for your answer!


PJ wrote on September 19th, 2007 at 1:35 am


Hi PJ,

Thats a nice question. But, i actually think that there is no way to do such a 301 redirect on your blogger account. Like you want to Right ?

I think thats not possible.

Hari wrote on September 19th, 2007 at 8:46 am


Hi Hari,

Thank you very much for your reply.

I see. Yes, that is what I would like to do. A month ago, the Google PageRank of my non-WWW site (which I do SEO for) dropped from 4 to 2. I still can’t figure out what happened. Even though my traffic has not been affected at all (it has still been increasing steadily), I would still like to bring the PageRank back up. (By the way…my WWW site has always had a PageRank of 2.)


PJ wrote on September 19th, 2007 at 2:47 pm


Yea, having different ranks for different domains is a pain. Haven’t you considered moving on into a self-hosted blog, if you are serious about blogging ?

Hari wrote on September 21st, 2007 at 1:37 am


Hello Hari,

I have been considering it indeed. I will probably work with a friend of mine who can help host my blog.

PJ wrote on September 21st, 2007 at 1:54 am


Oh Cool ! If you are looking for free hosting, try Just started out recently. They don’t have cPanel. Thats what i don’t like.

Hari wrote on September 21st, 2007 at 2:03 am


Thank you for the information! I will have a look at it. I will e-mail you if I have any question.

PJ wrote on September 21st, 2007 at 2:13 am


Great post! Thanks for the info, keep up the good work!

Popcorn Ninja wrote on October 16th, 2007 at 5:44 am


Yup, I’ve done the same with my website.

Norman wrote on January 10th, 2008 at 12:14 pm


Thank you for this information, I actually just remembered that htaccess is that powerful with link redirections to my main page, I’ve heard rumors saying that www can actually mess up your google SERPS.

Web Development Blog wrote on April 23rd, 2008 at 4:02 am


www can actually mess up your google SERPS.

Hmm.. I’ve not heard that before…

Hari wrote on April 23rd, 2008 at 7:35 am


A good man would prefer to be defeated than to defeat injustice by evil means.

Chicago wrote on May 20th, 2008 at 3:55 pm

Leave a Reply