3

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?

Community
  • 1
  • 1
Tony
  • 9,870
  • 19
  • 82
  • 133
  • https://stackoverflow.com/questions/43275814/how-to-redirect-traffic-from-non-www-domain-name-to-www-example-com-in-aws-route is also similar – thaddeusmt Jan 31 '18 at 21:39
  • There is a similar question, here you can find the [answer](https://stackoverflow.com/questions/22053472/how-do-i-redirect-a-naked-apex-domain-to-www-using-route-53/69644219#69644219) – Diego Bianchi Oct 20 '21 at 10:26

1 Answers1

-1

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.

  • Update: this may not work well if you have a CNAME for the www.example.com address. If you do, the browser may complain about too many redirects. – user2407387 May 10 '17 at 19:22
  • 1
    I have that exact problem. Route53 doesn't allow me to create a CNAME for the naked domain also Any other option? – Tony Jun 15 '17 at 21:58
  • 1
    user2407387, any thoughts? – Tony Jun 21 '17 at 19:36