Using One Hostname
You work so hard to get your site placed highly in the search engines. However, you find that different search terms use different pages on your site depending on how people link to you. Some may prefer to use the “www” while others will leave this off.
The problem with that is the search engines see that as two different domains. If you are using Apache and have access to .htaccess files the best thing to do is redirect all your urls to either use “www” or not. I prefer not.
Here is the code I use:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^bigmoneytips.com$ [NC]
RewriteRule (.*) http://bigmoneytips.com/$1 [R=301,L]
With this code all of my pages and PR go to one domain instead of being split. If you are doing this to a new site that has yet to be indexed you are fine. If you are going to do this with an existing site then expect a tiny fluctuation as the search engines adjust.
Related Stories
POSTED IN: Webmaster Tools
9 opinions for Using One Hostname
bryan
Aug 17, 2004 at 8:35 am
How long did it take the PR to transfer between domains?
Scrivs
Aug 17, 2004 at 8:40 am
Unfortunately I do not have the answer to that since it is up to Google. It all depends on when they do their next PR update after you make the changes. However, I found that traffic does not drop at all. It seems their own internal PR keeps everything up to date.
Of course that is just my guess.
Hadley Wickham
Aug 17, 2004 at 3:18 pm
Google seems to be able to figure out that two domains are the same, at least for with and without http://www.
Scrivs
Aug 17, 2004 at 3:23 pm
Hadley, I would have to disagree because for the CSS Vault the non-www domain had a PR of 7 while the www had a PR of 6. Therefore, a change was necessary to stabilize it to one PR rating.
Google may recongnize that it’s one domain for other reasons, but it will definitely assign different PR’s, which might coincidentally be the same.
Andrew
Aug 18, 2004 at 3:36 am
It also works beautifully for redirecting different domains to your main domain
Andrew
Aug 21, 2004 at 4:10 am
and my PR transferred within one day…
mangafaua
Nov 13, 2004 at 11:34 am
actualy i did this in a simpler manner (i think) :
RedirectMatch permanent (.*)$ http://www.xxx.ro1
James
Nov 18, 2004 at 6:47 pm
I wonder if the internal PR still has the differing PRs…
and thanks for the code Scrivs, been looking forever for something like this :)
Thame
Sep 15, 2005 at 9:44 pm
Thanks, that’s a great tip, I actually needed to go the other way, because I built up my site with the www prefix.
Have an opinion? Leave a comment: