I have seen a few questions about this but the answer is not working for me. I want to redirect the naked domain to www. I have my site deployed in a S3 bucket and a Cloudfront distribution.
This questions are similar:
https://serverfault.com/questions/576461/redirect-non-www-requests-to-www-on-amazon-route-53
How do I redirect a naked (apex) domain to www using Route 53?
This is what I have:
- A static website in a S3 bucket: www.mysitename.com
- Another website (empty) in a S3 bucket: mysitename.com configured to be redirecting everything to www.mysitename.com
- A cloudfront distribution over the bucket www.mysitename.com
- Route 53
Everything works well in the www.mysitename.com domain, but the naked domain is not working.
The ways it's configured in Route 53 is the following:
- A Record, www.mysitename.com with Alias to my Cloudfront distribution (works perfect).
- A Record, mysitename.com with Alias to my S3 bucket.
If I go to my "mysitename.com.s3-...." S3 bucket it redirects correctly to the other bucket. But If I go to the naked domain, it doesn't work.
The error I get is:
This site can’t be reached xxxxxxxx.com took too long to respond.
Try: Checking the connection Checking the proxy and the firewall Running Network Diagnostics ERR_CONNECTION_TIMED_OUT
It resolves to a Amazon S3 IP correctly. If I go to the IP it opens https://aws.amazon.com/s3/.
What am I missing?