I have looked at documentation on how I can redirect my traffic from one domain to another in AWS but to no avail I am unable to. The way I see the process using AWS is like so:
Route 53 ----> S3 ----> CloudFront ----> ALB ---> CloudFront?
What I have done are the following:
- I modified the A record of
monkey.com
's CloudFront ID444fasdfdd.cloudfront.net
to point to the CloudFront ID3dfdsafds3.cloudfront.net
ofape.com
. - I modified the ALB used for monkey.com and created a Listener rule to redirect traffic of
www.monkey.com
andmonkey.com
toape.com
- I went to monkey.com's S3 bucket which is using Static Web Hosting and redirected the bucket to go to
ape.com
. - This is where I am stuck, I do not know what to do on
monkey.com
's CloudFront Distribution. I want to change the "Alternate Domain Name (CNAME)" ofwww.monkey.com
andmonkey.com
towww.ape.com
andape.com
and replace the Custom SSL certificate of*.monkey.com
with*.ape.com
; however, I receive an error saying I already have a Distribution ofape.com
(which is true).
I hope I made myself clear on the issue I am having. If you want me to clear up any confusion please let me know.
CodePudding user response:
If you edited Route 53 A record for monkey.com
to the CloudFront of ape.com
, you are using ape.com
as the backend, but the URL in the viewer's browser will still show as monkey.com
.
Instead, what you need to do is keep Route 53 monkey.com
and point it to a dummy website whose only purpose is to return a redirection to the new domain. You can use S3 website for this, or any other web hosting for that matter. Example of using S3 for redirection.