www-less urls are not handled by CDN?

Paul Marsh 1 Reputation point
2020-07-11T09:57:54.05+00:00

I have 2 domains registered with the CDN; mydomain.com and mydomain.co.uk. The .com variant works fine. When I use the full url, www.mydomain.co.uk, it works too, however if I skip the 'www' part it fails. E.g. this does NOT work; mydomain.co.uk
I don't understand what the problem is. Any ideas?

Azure Content Delivery Network
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 43,806 Reputation points Microsoft Employee
    2020-07-13T07:33:34.047+00:00

    @PaulMarsh-3273 Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused

    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.

    Please refer to this article: https://learn.microsoft.com/en-us/azure/cdn/cdn-map-content-to-custom-domain#create-a-cname-dns-record

    Also, you can implement redirection in your server or CDN.

    When someone tries to access example.com, you can do a 301 by sending http://www.example.com in the location header.

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.