Redirect domain old to new domain automatically

0

How i can assign my old domain to new domain automatically?, can anybody help me please?.

example case : example.com (old) example1.com(new)

My Goal : if someone access web example.com, their will be assign to example1.com automatically.

3 Answers
1

If you are using an application load balancer, host-based routing is recommended.

https://aws.amazon.com/premiumsupport/knowledge-center/elb-configure-host-based-routing-alb/?nc1=h_ls

profile picture
hayao-k
answered 2 years ago
  • Yesterday, I try for change rules on load balancer. And It work like you said, thank you for the hint :).

1

Another method would be to use s3 bucket redirection with Cloudfront, and an ACM certificate.

You need to setup an s3 bucket named "example1.com" (the website that you want to redirect to). to do that, create the bucket => go to properties => scroll all the way down to "static website hosting" => set static site hosting to enabled, hosting type to redirect requests for an object, hostname to "example1.com", protocol to none.

Create an ACM certificate for your domain. go to ACM => request a certificate, put in the FQDN of the website that you want to redirect to (example1.com). you will also need to validate the certificate

Create a cloudfront distribution. enter your origin (This will be the value that you get from s3 as the bucket website endpoint. ex: bucket-name.s3-website-us-west-2.amazonaws.com), change the viewer protocol policy to "Redirect HTTP to HTTPS", give an alternate CNAME record (www.example1.com, example.com), choose your SSL certificate that you created in ACM, create distribution.

Go to your hosted zone in route 53, create an alias A record pointing to the cloudfront distribution that you created.

here are some resources that I find helpful: https://simonecarletti.com/blog/2016/08/redirect-domain-https-amazon-cloudfront/ https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/

answered 2 years ago
0

A simple Domain CNAME can accomplish this. A set up documentation from GoDaddy here. Respective DNS hosting Orgs/Domain Registrars will provided similar documentation.

https://www.godaddy.com/help/add-a-cname-record-19236

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions