Stop serving content from your Azure url

When you set you site up on azure, you get a .azurewebsites.net url. You can then point your domain to this. Yet, sometimes google will try and index the azure url too.

That means you could get penalised for duplicate content. That's a bad thing, right? Well, not always as Google aficionado Matt Cutts confirms:

However, having your content available on many url's means Google could potentially serve up your azure url instead.

There are a few ways around this. The easiest way I have found is to add a rewrite rule in to the system.webServer section of your web.config:


    
      
        
          
          
            
          
          
        
      
    
  

​This means that anyone who lands on your azure url will be redirected to the right place safe and sound. Also, by making it a permanent redirect it means google will update it's index to your domain.

Don't forget to change the azure url and the destination url, unless you really want to give me some free traffic...