Help with S3 and CloudFront Setup: Why is www redirecting incorrectly?

0
0
Asked By CuriousCat123 On

I'm struggling with my S3 and CloudFront configuration and have tried looking for solutions all over. Here's my setup: I have two S3 buckets, one for my main site (example.com) and one for the www version (www.example.com), which redirects to the origin bucket. I also set up two CloudFront distributions—one for each bucket, with respective TLS certificates. However, when I go to www.example.com, it seems like it redirects to a CloudFront URL instead of the proper custom domain, adding some weird stuff to the URL. Could someone help me figure out what I'm missing?

1 Answer

Answered By TechSavvyDude42 On

You really don't need two buckets for this setup. It's actually simpler to have just one bucket for the www version. Then, on your DNS provider, you can set up a redirect from your root domain to the www. That way, everything gets rerouted smoothly, and CloudFront will handle the HTTPS for you!

CuriousCat123 -

Thanks! I had a feeling the two buckets were a bit overkill. This much simpler method sounds way better!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.