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:


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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.