0

So i've been trying out cloudfront from AWS.

Why is the URL 'example.com' resolving to 'example.com.s3.eu-west-1.amazonaws.com' in the Address Bar? I've tried googling loads of questions with this problem but the fact that i'm not seeing any relevant answers is telling me i've configured it wrong.

If AWS are advertising whole-site delivery, surely the idea is that you always see www.example.com/[PATH] in the address bar!?

I now navigate to example.com/index.html, and it redirects to example.com.s3.eu-west-1.amazonaws.com/index.html. What I want to see is still "example.com/index.html" and all the CDN magic should happen behind the scenes to the end-user.

  • I've got an S3 bucket as my origin serving static content. I've set up 2 buckets in total, example.com containing all my content, and www.example.com with a redirect to example.com
  • I've setup my DNS in Route 53 with an A-record ALIAS on the root domain name (example.com) pointing to my Cloudfront domain name. I've also got a CNAME record for www.example.com pointing to example.com
  • I've added "example.com" and "www.example.com" as alternate CNAME's in my cloudfront distribution.

What am I missing here?

Edit: Thanks Halfgar - I'm new to this community.

$ curl --head www.example.com

... 

Location: example.com.s3-eu-west-1.amazonaws.com 

... 

$ curl --head example.com 

... 

Location: example.com.s3-eu-west-1.amazonaws.com 

...
  • Can you post the response headers from curl --head www.example.com and curl --head example.com. I'm primarly interested in the Location header. Also, are you running Apache? Can you enable the rewrite log and see if that turns up anything? – Halfgaar Sep 27 '15 at 10:08
  • I'm not using Apache anywhere. The architecture at this point is exclusively Client -> Cloudfront -> Amazon S3. (No EC2 anywhere as of yet). – Niccaman Sep 27 '15 at 11:05
  • $ curl --head www.example.com ... Location: example.com.s3-eu-west-1.amazonaws.com ... $ curl --head example.com ... Location: example.com.s3-eu-west-1.amazonaws.com ... – Niccaman Sep 27 '15 at 11:06
  • (When adding results like those Location headers, you can edit them into your original post, to make it more clear). – Halfgaar Sep 27 '15 at 11:55

Your Answer

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

Browse other questions tagged or ask your own question.