简体   繁体   中英

“www” CNAME not working for S3 bucket

I have a website comprised of a few static pages hosted on an AWS S3 bucket. I added an A record that maps mysite.com to the bucket's address (via an alias). I also want users to be able to access my site via www.mysite.com , but when I add a CNAME mapping www.mysite.com. to mysite.com it does not work. What could I possibly be doing wrong?

The domain name has to match the bucket name. The fix is to create a second bucket with www. in the name, point your www CNAME to that, and configure that bucket to redirect to the other bucket that contains your website.

The www.mysite.com should be an A record pointing to a separate S3 bucket. If you want users to always go to your www site then you'll put your site files in the www bucket and setup your top-level domain bucket to redirect to www.mysite.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