How-to-simply...

Setup consistent urls without www on your domain in IIS and Webmaster Tools

  • 1 Add new CNAME record named www in your webhosts domain control panel. Don't forget adding dot . at the end of the address field.
    For mywebsite.com it will be (name, record type, address) www CNAME mywebsite.com.
  • 2 Login to your server. Run IIS Manager and add 2 new websites:
    The first one will be named mywebsite.com
    Enter same name into the 'Host name' field in site bindings.
    The second will be named www.mywebsite.com
    (same text in the 'Host name' field)
  • 3 Verify both sites in webmaster tools.
    (Add site and follow the instructions)
  • 4 Add url rewrite (301 redirect) to the web.config file in www site folder. This requires url rewrite module installed on your webserver.
    Note: You can't verify your site in webmaster tools while url rewrite is redirecting all requests.
  • 5 In Webmaster Tools go to Configuration->Settings->Preferred domain
    and select 'Display URLs as mywebsite.com' Click Save and you are done.
  • N Here is the web.config of www site (this one is redirecting to the non www version)
    ...

References