Matt Farina - Tech / Faith / Life

WWW or No WWW, that is the SEO Question

In

Did you know that the "www." is your sites URL could be hurting your search engine ranking? When most of us go to a website we start by typing in the standard "www." before we get into the name. Some tech savvy people know that we can omit those 4 extra key strokes for sites but most, even those who know, have it added in by habit. Yet, the fact that sites support both actually hurts search engine ranking. Thankfully there is a way to fix it; but, first you have to decide to www or not www your site.

A Little History

Back in the early days of the Internet the "www." mattered. It was a way of getting you to the right content on the right server. It was a necessarily thing.

The early days of the Internet are long gone and the need for this fell off the charts long ago. But, support has remained and now when google indexes your site it indexes the "www." version and the non-"www." version.

A Joomla! Example

The open source content management system Joomla! is a recent example of this hurting a sites ranking. The site www.joomla.org recently took a hit in the rankings while joomla.org stayed high. The reason for this is that they are seen as 2 separate sites and the sites were ranked differently by the google wizardry.

The Fix

Luckily the solution for this is rather easy. Just have all sites that go to the "www." redirect to the non-"www." version or vice versa. Then search engines will see just the one site. For sites using Apache this is a simple site modification.

The Decision

Before you can make the redirect you have to decide if you want "www." on your site or not. This has become the common way to do it. Yet, it is 4 extra characters for people to type. This is the way we are used to. But, it's not really needed. There are a host of sites out there debating this and it might be worth a search and a read. Some sites like drupal.org, wordpress.org, and slashdot.org remove the "www.". Other sites like www.apple.com and www.yahoo.com add the "www." onto their url. It's a personal decision and you have to make it before moving on.

The How To

If you want to remove the "www." add this to your .htaccess file (this works for Apache). If you don't have a .htaccess file create one with this in it.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

If you want to add the "www." add this to your .htaccess file (Apache only). If you don't have a .htaccess file create one with this in it.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

In both cases swap out the example part for your domain and the .com part for something else if you are not a .com.

Your Decision

If you choose or have chosen to go with "www." or no "www." I'm interested in knowing which way you went and why. There are a great many web developers tackling this question and the more input the more we all can make better decisions on this issue.

www OR not www? IMHO, www is

www OR not www?
IMHO, www is a bit rustic form.
Personally, I like urls without www, more (like drupal.org). It's just "more readable" for humans :-)
For computers ... They really don't care about "fancy" urls. They like IPs :-)

To www is human...

Using www.example.com instead of example.com (which is my choice for most cases) can be used to apply the principle of least astonishment, when sites use multiple (v)hosts within their domain.

Think, for instance :

  • api.drupal.org
  • cvs.drupal.org
  • groups.drupal.org
  • lists.drupal.org
  • scratch.drupal.org
  • drupal.org

Can you spot an intruder in that list ? using www.drupal.org instead would have kept the regularity of the naming scheme.

But, of course, using drupal.org for the most visited site also makes sense, since it will be the one typed most often.

Another way

If you're using Google Analytics for your site, another way is to define it in the google account as the preferred domain to index. This shows up after the analytics code has been put on the site's pages and Google has tracked the code.

Of course, the .htaccess example is probably more useful for all search engines.

no-www.org and Google Webmaster Tools

Here are two more handy resources:

  • no-www.org has more info about dropping or redirecting the www portion of your hostname.
  • Even without using Analytics or a sitemap, you can claim your domain at Google Webmaster tools and then set a preference for merging your www and non-www listings. (I think maybe that's what venkat-rk meant to say.) This site will also let you learn a lot of other things about how Google sees your web site.

micah

yes-www.com

Don't forget about http://www.yes-www.org/. A site that is the opposite of the http://no-www.org site.

yes vs no www sites

Hadn't seen that one. I'll have to take a closer look at it.

No WWW

I use no www because it looks cleaner. My site is Class B on http://no-www.org using mod rewrite to take off the www.

Google Page Creator

I have my cname records set up under my godaddy admin for one of my domain names to point to some google pages I've created under my "Apps for your Domain" Account. So there isn't a way for me to upload a .htaccess file.

Currently my CNAME is set up like this:
Host: www
Points To: ghs.google.com

Is there a way to set my domain up so that when you go to the no-www version the site will actually load?

2 jump

I'm sure is a better way, but if you are pointing www to a certain site you can point the non-www to the www and then www will jump to your pages.