How can I redirect one domain to another in Route 53?

2 minute read
2

I want to redirect my client from one domain to another domain in Amazon Route 53.

Short description

You can redirect a domain to another domain when you use Route 53 with an Application Load Balancer, Amazon Simple Storage Service (Amazon S3), or Amazon CloudFront. Each method has different capabilities.

Resolution

You can redirect a domain to another domain when you use Route 53 with other AWS services. The following methods support different redirect behaviors.

Use an Application Load Balancer for domain redirection

Application Load Balancer supports HTTP to HTTPS redirection and domain name redirection.

Use Amazon S3 and CloudFront for domain redirection

Set up a static website in an S3 bucket and configure it to redirect traffic. However, S3 only supports the HTTP protocol. To redirect from HTTP to HTTPS, use a CloudFront distribution with the S3 bucket.

Use a CloudFront function for advanced redirection

CloudFront functions support redirection at the edge based on viewer request information.

  • You can redirect all traffic to a different domain or only specific pages.
  • For details, see the Use an edge function that redirects requests to the new domain section of How do I redirect a domain in CloudFront?

Important:

  • Redirection changes the domain name in the browser.
  • CNAME or alias records preserve the original URL and don’t perform a redirect.
3 Comments

very nice, it solve my problem of forwarding.

i was suppose to forward my domain www.yatricab.com to www.yatricabs.com and i was confused how to do that.

i have done forwarding from google domains, go daddy, & bigrock portal because there is a dedicated button available and no need to do anything in dns setting. so that was quit easy. but some how my issue got resolved.

thanks for this article by aws

replied 10 months ago

so using s3 bucket is mandatory for redirection rule?

replied 4 months ago

So many ways to do the same thing, for redirects. Which one is cheapest or preferred for any other reason?

S3 bucket just for redirection feels weird to me. Why invoke a storage service just for a redirect? I'm surprised that's mentioned first. Maybe it's just easiest to configure.

CloudFront Function sounds simplest if managed by developers themselves.

replied 2 months ago