0
votes

My case is probably the opposite to what others are doing (naked to www), but the problem is the same.

This is the current setup I have.

CloudFront: I created 2 distributions. One of them has as origin and CNAME www.domain.com, the other one has domain.com. They both redirect HTTP to HTTPS and point to different S3 buckets.

S3: There are 2 buckets. One hosts the static website (naked), and the other one merely 301 redirects to the first bucket.

Route 53: I have 2 hosted zones, one for each case, pointing to the respective CloudFront distributions. However, I copied the name servers to my domain hosting settings (NameCheap) only for the naked hosted zone.

Should I copy the other name servers to NameCheap custom DNS too? That would make already 8 rows out of 11 which is the NameCheap limit. I read an article about this somewhere but unfortunately I lost it!

1

1 Answers

3
votes

It sounds like you created two hosted zones, one domain.com and one www.domain.com. What you will want to do is

  1. Delete www.domain.com hosted zone.
  2. Create www resource record in domain.com zone and point it to the relevant cloudfront distribution
  3. Update your registrar with just the domain.com name servers