0

I'm really new to Amazon CloudFront.

I have set up an S3 with Cloudfront, then I'm using a custom domain that I setup in CloudFlare.

I can access my photo normally with this kind of link : https://cdn.example.com/img.jpg

But then, when I try to open it with the www version, https://www.cdn.example.com/img.jpg

The content won't open and give error.

See here:

https://i.stack.imgur.com/45Viz.jpg

Is there any solution available to auto redirect to non www ?

Pau Garcia
  • 56
  • 8
Matz
  • 1
  • Try this https://stackoverflow.com/questions/28675620/cloudfront-redirect-www-to-naked-domain-with-ssl https://stackoverflow.com/questions/22740084/amazon-s3-redirect-and-cloudfront ....................................... – Passatizhi Jun 03 '19 at 03:53

1 Answers1

0

I see you are experiencing a DNS issue. The reason you could not open the address is that the DNS www.cdn.example.com was not found, because you probably didn't set it up in your DNS configuration.

You can fix it by adding a CNAME record in DNS Management, which would be a line like this in your DNS configuration:

www.cdn.example.com CNAME   cdn.example.com

After the time it takes to propagate, you can verify it works.

Pau Garcia
  • 56
  • 8
tien
  • 65
  • 4