1

I have set up two S3 Buckets for domain.com and www.domain.com and distributions for both on Cloudfront. Bucket with www just redirects requests to non-www bucket static Endpoint. So basically it repeats steps from this answer. The only difference is, I used REST origins instead of static URL provided by S3 Buckets.

The problem is when I'm accessing www.domain.com it redirects to domain.com but it appends index.html at the end of the URL, and this messing with ReactJS somehow - the page simply does not render. Direct call to domain.com works fine, no index.html at the end.

What could be wrong with the setup?

Katherine
  • 576
  • 1
  • 7
  • 19
  • Is this to do with the [Default Root Object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) configured in CloudFront? – madebydavid Mar 17 '19 at 13:42
  • @madebydavid The distribution for `non-www` bucket uses `Default Root Object`, without it I get access denied. But `www` one, I tried with and without, then thought this might have something to do with cache, so I invalidated it, the result is the same. – Katherine Mar 18 '19 at 12:35

0 Answers0