Currently have an Azure CDN Premium Verizon (P1) Profile that is being used with an Azure Web App.
What is the best way to 301 redirect all requests to
YourWebsiteName.azureedge.net
and
YourWebsiteName.azurewebsites.net
To the Custom Domain: YourWebsiteName.com
Using the Rules Engine at https://cdn.windowsazure.com/http/rules/default.aspx
Don't want 3 URL's pointing to the same content.
Currently the URLs
- YourWebsiteName.Com
- YourWebsiteName.azureedge.net
- YourWebsiteName.azurewebsites.net
All points to the same exact content.
SEO wise this is not good and would like to know what is the best way to redirect the Two Azure provided URLs to the Custom domain for all requests.
When visiting all 3 URLs they work and I don't want them to.
Only want the Custom Domain: YourWebsiteName.com to be accessible to the public and Search Engines.
Only want 1 Domain the Custom domain to point to the content of the website and not the Azure URLs.
You won't be needing the rules engine to point the other two URL's (*.azurewebsites.net and *.azureedge.net) to your custom domain.
To have the three URL's all point to the first one, i.e. the custom domain, you need to sign in into your service provider from whom you purchased the domain name, and then add two
CNAMErecords, anArecord and aTXTrecord as outlined in the two articles below.Tutorial: Map an existing custom DNS name to Azure App Service
a. Add a
CNAMErecord to point your azure websites subdomainyourwebsite.azurewebsites.netto point to thewwwsubdomain of your websitewww.yourwebsite.com.b. In the Azure portal, on your App Service panel, verify that
CNAMEyou just added.c. In the DNS panel of your domain provider once again, create an
Arecord that points to the IP address of your app serviceyourwebsite.azurewebsites.net.d. Finally, create a
TXTrecord in the DNS panel of your domain provider to point the URLyourwebsite.azurewebsites.nettoyourwebsite.comso that Azure may verify that you own the domainyourwebsite.com.Tutorial: Add a custom domain to your Azure CDN endpoint
a. To verify your domain, add a
CNAMEthat reads likecdnverify.yourEndpointNameOnTheCDN.azureedge.netand let it point to your CDN endpointyourEndpointNameOnTheCDN.azureedge.net.b. To map your domain name to the CDN endpoint, create a second CNAME with the name of your custom domain
yourwebsitename.comand let it point to your CDN endpointyourEndpointNameOnTheCDN.azureedge.net.