I assume you have a web application. You will need to create a redirect rule that checks which domain has been requested, and if it matches *.cloudapp.net , then redirect to mydomain.com permanently.
In web.config something like this answer :
<rewrite> <rules> <rule name="Redirect to www" stopProcessing="true"> <match url="(.*)" /> <conditions trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^.*.cloudapp.net$" /> </conditions> <action type="Redirect" url="{MapProtocol:{HTTPS}}://www.domain.com/{R:1}" /> </rule> </rules> <rewriteMaps> <rewriteMap name="MapProtocol"> <add key="on" value="https" /> <add key="off" value="http" /> </rewriteMap> </rewriteMaps> </rewrite>
Disclaimer: I have not tested this redirect in web.config . My applications run Asp.Net MVC, and I redirect, adding a global filter that does a few extra checks.
source share