title: Best practice for http redirection for Windows Azure
body: <p>I have an azure website which is named:</p>
  
  <ul>
  <li><code>http://myapp.cloudapp.net</code></li>
  </ul>
  
  <p>Of-course this URL is kind of ugly so I <a href="http://blog.smarx.com/posts/custom-domain-names-in-windows-azure" rel="noreferrer">set up a CNAME</a> that points <code>http://www.myapp.com</code> to the azure url. </p>
  
  <p>All is well up until here, but there is a snag. </p>
  
  <p><code>http://myapp.cloudapp.net</code> has leaked out and now is indexed by google and lives on other sites. </p>
  
  <p>I would like to permanently redirect any requests for myapp.cloudapp.net to the new home at www.myapp.com </p>
  
  <p>The website I have is coded in MVC.Net 2.0, as this is an azure app, there is not UI to access IIS and everything needs to be done in application code or web.config. </p>
  
  <p>What is a clean way to set a permanent redirect in place, should it go in web.config or in a global controller? </p>