-1

I have a S3 bucket called download.mydomain.com

My DNS is managed by a local host and they have set up a CNAME to map download.mydomain.com to s3.amazonaws.com. In so doing, this works perfectly:

http://download.mydomain.com/myimage.jpg

I am working on moving my hosting and having trouble getting this to work right with a new DNS provider. Using a different domain for testing purposes, I have a bucket called square.somedomain.com

I set up a CNAME to map square.somedomain.com to s3.amazonaws.com and then try the url:

http://square.somedomain.com/square.jpg

It finds the image, but then the URL in the browser is changed to:

http://square.somedomain.com.s3-us-west-2.amazonaws.com/square.jpg

How can I prevent this? On my working main domain it does not refresh with the extra "s3-us-west-2.amazonaws.com" in the browser address bar.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Trygve
  • 1,317
  • 10
  • 27
  • 1
    Did you enable static site hosting on the S3 bucket? – Mark B Sep 11 '16 at 22:43
  • No. None of my other buckets have this enabled and they are all working fine. I am only hosting images and other binary files, not a website. – Trygve Sep 11 '16 at 23:53

1 Answers1

0

Use Static Website Hosting. It will maintain the URL for your website.

When configuring the CNAME record, use the URL provided in the console (eg www.example.com.s3-website-us-east-1.amazonaws.com) rather than the normal S3 URL (eg www.example.com.s3.amazonaws.com).

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • I am not sure that will work for a subdomain. My main site will not be at Amazon, as I only want an S3 subdomain. – Trygve Sep 12 '16 at 12:55