I have a Joomla site on Azure. I have set up the .com properly and I understand why the *azurewebsites.net URL is still working.
I wanted to redirect all traffic from *azurewebsites.net to the .com. I followed this guide and it works as intended. http://onthecloud.azurewebsites.net/seo-tip-how-to-block-the-.azurewebsites.net-domain
However, I also have an Azure CDN in place (mycdn.azureedge.net/). I use JCH Optimize to set up the CDN. I see the the calls to mycdn.azureedge.net/ are generated properly. However, somehow, because of the web.config redirect, all the traffic is redirected from the CDN back to my .com, which defeats the purpose of the CDN. This creates a lot of redirect calls.
Is there a way to write the web.config lines to exclude the CDN?
Here's what my web.config looks like. When I delete those lines, the CDN redirects disappear, so the problem is really here.
<rule name="Disable Azure Domain" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="*.azurewebsites.net" />
</conditions>
<action type="Redirect" url="http://www.example.com{REQUEST_URI}" redirectType="Permanent" />
</rule>