April 29, 2008 Comments (22)

In addition to the .htaccess method you may want to indicate which www or non-www method in the google webmaster tools.
What about the issue where I have a master hosting account, then have subdomains under it? For example, my main site is www.harnesshouse.com. I have a subdomain called finearttouch.harnesshouse.com. I also have www.finearttouch.com pointing to that. Every now and then I'll see a search result that points to finearttouch.harnesshouse.com instead of www.finearttouch.com. Could I just do something like this:
RewriteCond %{HTTP_HOST} ^finearttouch\.harnesshouse\.com
RewriteRule ^(.*)$ http://www.finearttouch.com/$1 [R=301,L]
Glen
Thanks, nice post will Sphinn.
Yay! Excellent first post on SEG. Thanks for the simple tips and for explaining them in detail. It really helps those of us who have no clue what you're talking about understand better. Plus, my freebie preview lesson helped me understand it even more. ;)
@Chris Estes: Yes, that is absolutely true, it's a decent backup option. I don't recommend relying on that or other third party solutions though because even though Google has the largest search engine market share, it won't solve your problems with other search engines, and Google could potentially revoke that option at any time.
@Glen Harness: Upon a quick glance at your code, that should work fine.
@Jeff Howard, @Rachel Phillips: Thanks!
Hey Scott! Nice to see you here (can finally see what you look like too lol I usually think of your Keanu Reeve's avatar on the DP forum when I imagine what you look like)
Great post and tips. I use the Enforce WWW plug-in for my WordPress' blog. A good solution for non-techie people who don't want to tinker around with the htaccess file
@Michael: Hey! Good to see you here as well. Sometime ask me about why I chose that avatar of Neo - it will make you laugh. Thanks! That's a great piece of advice for WordPress bloggers. Now if only there were plugins for websites in general. :)
OK, so what if I have other subdomains at the same level? For example, www.mysite.com and mysite.com are the same site, but foo.mysite.com and bar.mysite.com are different ones, but run from the same server. If I use the rule to rewrite mysite.com as www.mysite.com, will that affect resolution of URLs for the other sites?
I always think it's best to use the www version to maximize SEO inbound links. People are used to typing in the w's.
Scott,
I think that your approach would be valid until a few months ago. Matt Cutts puts the question around two years ago. In fact Google gave different pageranks to theese URLs, but currently no. The back links, as well the pageranks, are the same if you search them either with www or not, or if you use index (or default).
Great tip - thanks! Took me less than 5 mins and your instructions made it super easy! www here we come....
Is there a way to verify the need? I checked about 30 pages on my website and they all had the identical PR, whether www or not. I know this was an issue a while back, and the pr was different on most of my pages (non www was lower). But things keep improving and I wonder if it is still necessary. Selecting the preference in Google tools may have made the difference for PR, but as was mentioned, other search engines may not have a handle on this.
@Ruy I've generally been thinking the same thing lately about whether this is necessary anymore (I do it on all sites I work on by default). Just this week though I ran a link search for a client that returned different results with and without the www subdomain. Weird
Hi Scott,
Great tip, but it doesn't work for me! Can you help?
Here's my code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ http://example.com/
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
I checked with my ISP and they're on apache.
I'm clueless.
Frak and Esoomllub,
Yes, I agree that we can find some differences with different tools. Even in the organic search the results may differ from a given search feature to other. But the point is: one URL had back links and PR, let's say, 4, and the other URLs had not back links and the PRs were zero. In addition, I suppose that the cited differences will disappear over the time.
@Janet: You shouldn't have any problems with subdomains because in most cases, rewrite directives of this kind in your main .htaccess won't affect your subdomains. As always, test things out first.
@Get Clickz Blog: Personally I would normally agree on using the www version, but there some good reasons for using the non-www version as well. Using the redirect mentioned above will forward all links to the correct version, and search engines will eventually pass on any link value to the correct version.
@Emily: You're welcome! Always glad to help. :)
@Ruy Miranda: I hear your point, but I would have to disagree. It's still important and valid to use this method for a number of reasons. While Google continually does get better with issues like this, I maintain my point that it's important to not leave it up to them, or any other search engine. You may see the same PageRank for sites with non-www and www, but I wouldn't rely on that information alone. The value of incoming links is much stronger when they are directed (or redirected) to the same version of the site. Keep in mind, Google isn't the only search engine. with sites that incoming links split between the two versions, I've seen rankings go up drastically (time and time again) within a short period of time of implementing only this fix, even recently. Also, it's simple a best practice to not have multiple versions of your site from a usability point of view, and it will make it easier for people to link to you.
@Frak, @Esoomllub: You may not see a huge problem with only 30 pages, but it's a lot easier to prevent SEO problems than to fix them afterward.
Scott,
Great article. Have a questions.. when i search my site I only get results with http://www.mysite.com not with the www
What does that mean? Thanks!
@Scott The site I noticed this with was a 19k page site. As I was saying though, this redirect is something I do by default on all sites that I am working on. Almost every site I've been brought in to do SEO work on though does not have this in place. As well, most of them don't have the basics of SEO in place, which means a quick boost in rankings is often easy to attain.
Thanks, Scott, I'd read about this before but the directions were confusing. Good tip from Chris about Webmaster Tools as well. When I tried this the first time, (and did it wrong), my Webmaster account noticed. Thanks again, Jill
Dear sears,
I have 5 web sites, and want to construct a web portal which will unify all sites in one (on new location, same IP) with new unique content. After this (constructing a new portal) want to redirect all this domains (301 redirection), to new one, we presume that this will not affect our position on Google, is it possible for us that Google bann us from index, because of redirecting 5 domains to one? I know that 301 is a legal, but I found different opinions, like
“If you 301 several different domains/web pages to ONE single page,
that ONE single page will get humped and dumped by google with no
apologies. DONT DO IT!
If you're already getting traffic from google, I would caution against
doing anything at all! If you do anything wrong with regards to
301/302/404, google will break it off in your culo and drop you so far
in the rankings that you will soon be on welfare.”
So if You be so kind to help I would appreciate.
Scott,
We have two different point of view: to me, currently a page with and without www has a unique version, not two. Out the area of PR the content in the two URLs is not view as duplicity by any search engine.
We have several sites on both IIS and apache servers. On the apache server, we are running phpsuexec so we cannot use .htaccess, how would we go about doing the above fix?

$100 in Free TLA's!
Increase your traffic and link popularity.
SEO Copywriting
Quality Content = More Traffic
Web Hosting
Windows Hosting and Linux Hosting
Sage not only personally invites you to come hear him speak at Search Engine Guide's upcoming Small Business Marketing Unleashed Conference, but he also reviews some of the show's best features. He highlights the top of the industry speakers, the wide array of in-depth topics to be covered and the appropriate, yet really fun conference location.
www.flickr.com
|
Search Engine Guide Blog | Search Engine Marketing | Internet Search Engines | SEM Resources & Consultants | Newsletters | Advertise | About | Site Map
Search marketing information for small business owners.
Fetching the best small business news.
A friendly place to share small business ideas and knowledge.
A different kind of small business marketing conference.
Home of our network.
Copyright © 1998 - 2008 K. Clough, Inc. All Rights Reserved. Privacy
FreeFind Site Search Engine - FreeFind adds a "search this site" feature to your website, making your site easier to use. FreeFind also gives you reports showing what your visitors are searching for, enabling you to improve your site. FreeFind's advanced site search engine and automatic site map technology can be added to your website for free.
(Unpaid placement - FreeFind is a Search Engine Guide partner.)