Why is my domain showing without www?

So, you've got your nice, brand new, shiny website - it's launched and you're waiting on the edge of your seat for it to appear in Google's results... and there it is! Time for celebration!

But hang on, something looks a little... different. For a minute you can't put your finger on it, and then you realise, all the other results are displaying their URL (aka domain name or web address) with 'www' at the beginning, and yours isn't. It makes yours look kind of - stunted.

So, what's going on?

Well, if you've been configuring your website in IIS on the server, then you'll know that you set up a www and a root domain. If you didn't, then go ahead and do that now, and if you didn't configure your IIS, then you'll need to check with whoever did.

This is good practice, because if you don't define it both with and without www, then is anybody tries to go to your website without the 'www', then they will get a flat fail, which is a jolly bad show.

The problem is that when you set both of them up, for some reason best known to themselves, Google treats them as two completely separate URLs.

Luckily, Google offers you the option to sort this out by merging the two and deciding which one you'd prefer to display. You do this by setting your preferred domain. Simply go into Webmaster Tools, Configuration - set preferred domain. It gives you three options:
  • Don't set a preferred domain
  • Display URLs as www.mydomain.com
  • Display URLs as mydomain.com
Unfortunately, as is often the case, things are not always so straightforward. When you try to choose one (display URLs as www.mydomain.com, if you're sensible) Google gives you an error that says:

'Part of the process of setting a preferred domain is to verify that you own http:/mydomain.com/. Please verify http://mydomain.com/.'

Great - but how do you verify that you own it?

Luckily, it's not that hard (once you know what you're doing - natch).

Simply go back into your Webmaster Tools overview and 'Add a site' with the domain without 'www' (or with, if you initially added without).

It will take you to the verification page. If you're left the original verification details in place, then all you need to do is click 'Verify' and hey presto, it will be verified. If you've removed the code, you'll need to go in and add it again.

Once this is done, you can go back to the configuration settings, select your option, and finally, Google will be happy, and will start displaying your URL correctly.

Comments and improvements on this post are welcome!