Per Amazon's instructions on hosting a static site on S3, I set my testing site up with two buckets: mydomain.tld and 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 www.mydomain.tld to mydomain.tld, which the simpler setup seems to do just fine.

1 Answer 1


There's no reason why having two A records won't work as you describe it, but the instructions are good practice because you should decide which is the canonical address of your site, www.domain.com or domain.com and redirect to the canonical name. Using two A records will make the site visible at both addresses.

Apart from the aesthetic considerations, this is particularly important for Search Engine Optimization (SEO) purposes as some search engines will treat your site as duplicate content if it visible at two domains.

By doing the redirect, visitors will be redirected with a HTTP 301 Moved Permanently if they go to the other URL and search engines will see that this is just an alias for your main site.

  • Thanks, very helpful information. Does the same apply if I used a CNAME record rather than a duplicate A record?
    – robmathers
    Jun 10, 2013 at 4:51
  • You can't use a CNAME for a root Top Level Domain like example.com but you could point www.example.com to the endpoint of your S3 bucket with a CNAME if you prefer.
    – ianjs
    Jun 22, 2013 at 10:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.