3
votes

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?

1

1 Answers

-1
votes

https://forums.aws.amazon.com/thread.jspa?threadID=55995

Shortcut:

Just point your naked/root domain to 174.129.25.170 and all requests to example.com will be redirected to www.example.com

No signup needed, uptime is published on a website. It is an EC2 instance doing only redirects.

Full disclosure: User "Dima" made this service.