Per Amazon's instructions on hosting a static site on S3, I set my testing site up with two buckets:
www.mydomain.tld. Per the instructions, the www bucket is configured to redirect to the top level bucket. In Route 53, the main domain is set as an A record alias for the
mydomain.tld S3 endpoint, and
www.mydomain.tld is a CNAME to the
www bucket endpoint. That all works as expected — traffic to the www domain is redirected to the non-
www, and the URL is rewritten accordingly.
However I was playing around with the configuration (partly because it seemed a bit unnecessary, and partly because I just wanted to see what would happen), and it looks like the second bucket is pretty much unnecessary. I removed the
www bucket, and changed the DNS for the
www subdomain to be an A record alias to the non-
www endpoint, and it all seems to work as expected.
Am I missing something? Is this going to fail horribly down the road, or are Amazon's instructions just outdated and/or overly complicated? All I want is to redirect
mydomain.tld, which the simpler setup seems to do just fine.