Search code examples
azureazure-cdn

Custom Domain to Azure CDN Endpoint with and without www


I have created an Azure CDN, an endpoint and working fine.

Created a CNAME www.mydomain.com to myazurecdn.azureedge.net Created another CNAME mydomain.com to www.mydomain.com

In Azure Endpoint, Custom Domain, I updated www.mydomain.com and it got propagated.

Now, when I navigate to www.mydomain.com, everything works fine but when I navigate to mydomain.com i get below response.

Our services aren't available right now

We're working to restore all services as soon as possible. Please check back soon.

Note: As Azure endpoint accepts multiple custom domain, I could add both www.mydomain.com and mydomain.com but it is not correct way, as I have many <a> tags with www.mydomain.com/link.

What to be done now to instruct system to use same route for mydomain.com and www.mydomain.com?

Is domain redirect from domain.com to www.mydomain.com only option?


Solution

  • Have a look at this,

    A custom domain and its subdomain can be associated with only a single endpoint at a time. However, you can use different subdomains from the same custom domain for different Azure service endpoints by using multiple CNAME records. You can also map a custom domain with different subdomains to the same CDN endpoint.

    You can use different subdomains in the same endpoint. Alternatively, I think you also could create two endpoints, one is for the root domain without www, the other is for a subdomain with www.