简体   繁体   中英

(Azure CDN Premium Verizon) Rules Engine: 301 Redirect all requests to azurewebsites.net and azureedge.net URLs

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

  1. YourWebsiteName.Com
  2. YourWebsiteName.azureedge.net
  3. 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, ie the custom domain, you need to sign in into your service provider from whom you purchased the domain name, and then add two CNAME records, an A record and a TXT record as outlined in the two articles below.

  1. Tutorial: Map an existing custom DNS name to Azure App Service

    a. Add a CNAME record to point your azure websites subdomain yourwebsite.azurewebsites.net to point to the www subdomain of your website www.yourwebsite.com .

    b. In the Azure portal, on your App Service panel, verify that CNAME you just added.

    c. In the DNS panel of your domain provider once again, create an A record that points to the IP address of your app service yourwebsite.azurewebsites.net .

    d. Finally, create a TXT record in the DNS panel of your domain provider to point the URL yourwebsite.azurewebsites.net to yourwebsite.com so that Azure may verify that you own the domain yourwebsite.com .

  2. Tutorial: Add a custom domain to your Azure CDN endpoint

    a. To verify your domain, add a CNAME that reads like cdnverify.yourEndpointNameOnTheCDN.azureedge.net and let it point to your CDN endpoint yourEndpointNameOnTheCDN.azureedge.net .

    b. To map your domain name to the CDN endpoint, create a second CNAME with the name of your custom domain yourwebsitename.com and let it point to your CDN endpoint yourEndpointNameOnTheCDN.azureedge.net .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM