- Newest
- Most votes
- Most comments
If you are using an application load balancer, host-based routing is recommended.
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/
A simple Domain CNAME can accomplish this. A set up documentation from GoDaddy here. Respective DNS hosting Orgs/Domain Registrars will provided similar documentation.
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 13 days ago
Yesterday, I try for change rules on load balancer. And It work like you said, thank you for the hint :).