Reputation: 2714
I have a problem with domain hosting in Route 53.
I need to redirect from xyz.com
to www.xyz.com
, so I created a Hosted Zone on Route 53. I added an A record with the address of my ELB, and a CNAME with a name of www.xyz.com
and value of my ELB address.
But this set up does not redirect my naked domain to my www
prefixed domain. How do I solve this issue?
Upvotes: 13
Views: 18457
Reputation: 742
you need to create a new Load Balancer
with Listener on port 80 http that redirect 301 to www.example.com
In case you have ssl running add another listener on port 443 that redirect 301 to www.example.com
go to Route 53
and create a Record A with naked domain the points the new load balancer
Upvotes: 1
Reputation: 1053
I just created two A records that both point the load balancer alias.
cstructor.com A loadbalancer-url
www.cstructor.com A loadbalancer-url
Upvotes: 0
Reputation: 21
Following the steps below will resolve your problem:
After the DNS changes take effect, browse to example.com and it should redirect to www.example.com
Upvotes: 2
Reputation: 12672
I've gotten this to work using both S3 and CloudFront.
You need two buckets: www.yourdomainname.com
and yourdomainname.com
.
Keep your files in the www
bucket. For the naked domain bucket properties, go to the "Static Website Hosting" section and select "redirect all requests to another host name", and enter www.yourdomainname.com
.
Upvotes: 13
Reputation: 9318
This is currently not possible using only Amazon Route 53. Please have a look into this thread for additional information.
Also, please be aware that a "naked domain" (e.g. xyz.com
) redirect should be handled in the HTTP layer, not in the DNS.
Upvotes: 2