I have setup two buckets on S3 one with www.mydomain.com and another with mydomain.com. All the files for my website are in the mydomain.com bucket.
On Route-53, I have made aliases from, (as suggested by answers to this question)
- www.mydomain.com to S3 endpoint.
- mydomain.com to S3 endpoint.
When I type mydomain.com, everything works fine and I see my website with mydomain.com in the URL. But using www.mydomain.com redirects to the s3 endpoint's naked URL, instead of the mydomain.com.
I also tried setting the following alias,
www.mydomain.com to mydomain.com
but that did not help either. What am I doing wrong?