Written by Irmak Tevfik on 29 - Jul - 2014

How To Create a URL Rewrite Rule for Azure Websites to use Single Custom Domain

While hosting your website with two different domains and same content might cause slight issues on search engine rankings. 
In case of Azure, we have:

Two active domains both on www.4sln.com and websitename.azurewebsites.net ​will cause Search engines to consider the earliest active website on ranking.
Simplest approach will be to include URL rewrite on publish web.config profile​ as:
       <rule name="SEOAzureRewrite" stopProcessing="true">
         <match url=".*" />
           <add input="{HTTP_HOST}" pattern="^oldwebsite.azurewebsites.net$" />
         <action type="Redirect" url="http://www.new-web-site.com/{R:0}" redirectType="Permanent" />
this rule will redirect all of the hits from old URL to the new one.

comments powered by Disqus