Skip to content

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

2 minute read
3

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

Resolution

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

Use an Application Load Balancer for domain redirection

An Application Load Balancer supports HTTP to HTTPS redirection and domain name redirection. Use an Application Load Balancer instead of Amazon S3 when your domain points to an Application Load Balancer, or for authorization-based, dynamic, or application-level routing.

For more information, see How can I use an Application Load Balancer to redirect one domain to another?

Use Amazon S3 and CloudFront for domain redirection

For basic use cases, set up a static website in an S3 bucket and configure it to redirect traffic. Amazon S3 is a low-cost option for static websites that don't use complex redirects. Don't use an Amazon S3 bucket to point to an Application Load Balancer, or for path-based, logic-driven, dynamic, or application-level redirects.

Note: Amazon S3 supports only the HTTP protocol. To redirect from HTTP to HTTPS, use a CloudFront distribution with the S3 bucket.

Use a CloudFront function for advanced redirection

Use a CloudFront edge function for complex redirects. The CloudFront function requires more setup than an S3 bucket, but is more customizable. You can redirect all traffic to a different domain or only specific pages.

Important:

  • Redirection changes the domain name in the browser.
  • CNAME or alias records preserve the original URL and don't perform a redirect.
5 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 2 years ago

so using s3 bucket is mandatory for redirection rule?

replied 2 years 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 years ago

I find it frustrating that AWS Route 53 complicates what should be a simple redirect process, and to top it off, users have to cover the costs themselves.

replied a year ago

Useful content !

replied a month ago