简体   繁体   中英

CNAME, & Amazon S3 bucket as subdomain

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.

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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM