Azure CDN custom domain redirect cloudflare

C Z 96 Reputation points
2021-06-29T15:05:47.263+00:00

Hi there,

We just migrated our media files of website from hosting server to Azure blob storage. We also added Azure CDN custom domain by following the direction of this page: cdn-map-content-to-custom-domain . We changed our domain name from www.mydomain.com to mydomain.com since www is now using by Azure CDN. However some users are still trying to use www.mydomain.com to visit our website and received an error message like this: 110343-%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE-20210629105216.png.

So is there anyway to make a redirect, let www.mydomain.com redirect to mydomain.com but do not redirect www.mydomain.com/mediafiles which is using by Azure CDN and blob storage? We are using cloudflare as DNS and Nginx.

Here is my cloudflare dns settings:
A mydomain.com ip_address DNSonly
CNAME www mydomain.azureedge.net DNSonly

Thanks a lot

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,428 questions
Azure Content Delivery Network
0 comments No comments
{count} votes

Accepted answer
  1. C Z 96 Reputation points
    2021-06-30T19:16:15.153+00:00

    After few days straggling, I decide to change a direction and resolve the problem.

    1. change CNAME back to mydomain.com on DNS server.
    2. In Azure CDN profile, add a new custom domain cdn.mydomain.com and enable https
    3. install a WordPress plugin to update all my media files urls from www.mydomain.com/mediafiles to cdn.mydomain.com/mediafiles

    now my users could visit www without any issue and all my images and videos are displayed correctly.

    0 comments No comments

0 additional answers

Sort by: Most helpful