Increase Your Search Engine Traffic by 15-20% in 3 Minutes
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
There are two different versions of your domain name:
- http://yourdomain.com
- http://www.yourdomain.com
Both versions of your domain name lead to the same page on your website. But the search engines count them as two separate files. The search engines index URIs and not web pages. Which leads to various problems.
Search Engine Canonicalization Problems
1. Because the search engines see two different version of your websites, the number of pages with duplicate content on them double!
2. Because people link to any of the two versions randomly, both versions will have average amount of back links. The search engines will show one version of your website and hide the another. But it will take into account all the links that point to only the version of your domain that they show in the results!
Thus, your pagerank won’t be as high as it should be. And your pages won’t generate as much traffic from search engines as it otherwise would. So what should you do?
The Technical Solution
The solution to the problem is slightly technical. But it isn’t too hard and takes less than 3 minutes to implement.
What we want to do is redirect visitors as well as search engines from one version of the website to another.
Part 1: Determining Which Version To Use
So which version of your website should you redirect people to? The one with WWW or the one without? There are arguments that support both sides. In short:
WWW: Most browsers will add www automatically with keyword shortcuts of “CTRL+Enter.” WWW depicts a website and is helpful in offline promotions. Most people have a habit of using WWW.
No WWW: WWW is extraneous typing. Its not required. It just bloats the web. There is a whole movement for No-WWW.
You may want to make your decision on those reasons. But there is a better way. Base your decisions on the number of backlinks each version of your website has!
Go to WWW or Not and find out which version of your website has more backlinks. And start using that.
Part 2: Redirecting From One Version To Another
To redirect one version to another, we’ll use 301 permanent redirection. You’ll need to open and edit .htaccess file in your root folder. And then add 3 lines to that file.
Copy and paste the code from below in your .htaccess file - depending on which version you go with.
Code to redirect to www from non-www version:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blogclout\.com [nc]
RewriteRule (.*) http://www.blogclout.com/$1 [R=301,L]
(replace blogclout.com with your domain)
Code to redirect to non-www version from www version:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^blogclout\.com [nc]
RewriteRule (.*) http://blogclout.com/$1 [R=301,L]
(replace blogclout.com with your domain)
Thats it. With the changes in place, your website should increase its page rank and attract more visitors from the search engines.
Action Summary:
- Visit WWW or Not and determine which version of the domain name should you keep.
- Update your .htaccess file accordingly.
- You should see 15-20% more visitors coming in from the search engines within 2-3 weeks.
Spread the word:
del.icio.us Digg Reddit StumbleUpon
If You Liked This Post, You May Also Like...













i know some plugins can do the work,
but it is more easy for the simple htaccess code,
thanks.
Posted 07 Sep 2007 #
Wallace: Thanks for your comment. I must admit, I didn’t even think of plugins for solving this problem. I’m sure there are a few plugins out there for people who use WordPress. Would love to know what plugin you’ve come across…
Posted 07 Sep 2007 #
I was reading a lot about this “problem” but never had the time to resolve it.
Your article convinced me to do that.
Posted 07 Sep 2007 #
Marko: Glad I could help you
Posted 08 Sep 2007 #
http://txfx.net/code/wordpress/enforce-www-preference/
Posted 08 Sep 2007 #
Wallace: Thanks a lot for the plugin link!
Posted 08 Sep 2007 #
Hi Ankesh,
I wanted to do that from a long time but couldnt figure out how to do…. I got this in my .htaccess file.
AddHandler php-fastcgi .php
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
I am not sure how to insert your technique. Please help me with what I have to replace or insert.
Your help is very much appreciated. Thanks.
Posted 08 Sep 2007 #
Nitinpai: You don’t have to replace any code. Just paste the relevant code in the post above anywhere in the same .htaccess file. Make sure that that .htaccess file is in your root folder. And not in your /blog/ or /wordpress/ folder.
Posted 08 Sep 2007 #
Awesome Ankesh,
I just pasted it and and now it works like magic. I want to know the details of this code. Please point me a resource/article which you might have read for coming to know about this.
Thanks a lot!
Posted 09 Sep 2007 #
Thanks for the tip.
Posted 10 Sep 2007 #
I used the “www or not” tool you suggested and found, that there are no links to non-www at all to my page. It’s not that I mind, but why is that? Maybe the bots don’t try the non-www version and there’s no public link at all to any non-www.
Anyway, I do a 301 as you told - but I don’t expect a raise in PR
Posted 10 Sep 2007 #
Nitinpai: Thanks for asking. What I did is searched for “Canonicalization” on Google and went through a couple of the articles. You may want to do the same thing for more information.
Leon: Thanks for the comment.
Pere: Thanks. The bots maybe still crawling your page but hiding it away because of duplicate content. You could also just search for “link: domain.com” and “link: www.domain.com” in the top 3 search engines (Google, Yahoo, MSN) to see what results you get. And base your selection on that…
Posted 10 Sep 2007 #
Thanks, this worked, and took less than 3 minutes…did it for 3 sites. Question…I also have word press, and had this line in addition to what the above poster wrote:
I inserted your code inside this “IF” loop. Is that OK?
BTW, I added this post to my “Sunday Seven” for last weekend if you want to check it out.
Posted 12 Sep 2007 #
[…] my “Sunday Seven” from this past week, and select Item number Four.A Here’s the Direct Link if you want to skip the other six interesting finds from last week!A Share and Enjoy: These […]
Posted 12 Sep 2007 #
Suzanne: Thanks for your link love
I just visited your blog and the WWW is working. The code works on any website - not only WordPress websites. So if you place it outside the “IF” loop, it should work too.
Posted 12 Sep 2007 #
@Ankesh
Thanks for reminding me - this has been on my “to do” list for weeks.
I added the htaccess code for my site - which works fine, but the blog I have in a subdirectory isn’t redirecting …
Take a look:
http://www.camstudio.org - this redirects
http://www.camstudio.org/blog - this doesn’t
Any ideas?
Cheers
Nick
Posted 14 Sep 2007 #
Nick: It seems to me that you have a .htaccess file in your /blog/ folder too - which is over-riding the .htaccess file in your root folder. I think if you open and edit the .htaccess file in your /blog folder - and add the code to it too, you’ll solve your problem.
Btw, I didn’t know you were behind camstudio - I’ve been using it since some time now! Thanks for resurrecting it!
Posted 14 Sep 2007 #