Amazon Route 53
HTTP to HTTPS redirection
URL forwarding
DNS management
website security

How to forward http request to https in Amazon Route53?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

Amazon Route 53 cannot redirect HTTP to HTTPS by itself because Route 53 is a DNS service, not a web server or proxy. DNS answers questions like "which IP or AWS resource handles this hostname," but it never sees the HTTP request path or sends HTTP status codes such as 301 or 302. To redirect HTTP to HTTPS, you need Route 53 plus an HTTP-capable service such as CloudFront, an Application Load Balancer, S3 website hosting, or your own web server.

Why Route 53 Alone Cannot Do It

A browser reaches Route 53 only for name resolution. After DNS resolution, the browser sends the actual HTTP request to the returned endpoint.

That means Route 53 can:

  • resolve example.com to a target
  • alias a record to CloudFront or a load balancer
  • route traffic at the DNS level

But it cannot:

  • inspect http:// versus https:// requests
  • return HTTP redirect responses
  • rewrite URLs

So the correct mental model is: Route 53 points traffic somewhere, and that somewhere performs the redirect.

Common AWS Patterns That Work

1. CloudFront

CloudFront can redirect viewers from HTTP to HTTPS using its viewer protocol policy. Route 53 then points the domain to the CloudFront distribution.

2. Application Load Balancer

An ALB can listen on port 80 and return a redirect action to 443.

3. S3 Static Website Redirect

For simple hostname redirects, an S3 static website endpoint can redirect requests to another HTTPS URL. This works for straightforward website redirection but is not a universal replacement for a full HTTPS-serving frontend.

Example: ALB Redirect

A clear HTTP-to-HTTPS setup is an ALB with two listeners.

  • port 80 listener: redirect to HTTPS
  • port 443 listener: serve the application

In infrastructure-as-code, the redirect listener looks conceptually like this:

yaml
1Type: AWS::ElasticLoadBalancingV2::Listener
2Properties:
3  LoadBalancerArn: my-load-balancer
4  Port: 80
5  Protocol: HTTP
6  DefaultActions:
7    - Type: redirect
8      RedirectConfig:
9        Protocol: HTTPS
10        Port: '443'
11        StatusCode: HTTP_301

Route 53 then creates an alias record to that ALB.

Example: CloudFront Viewer Redirect

With CloudFront, the key setting is the behavior's viewer protocol policy.

text
Viewer protocol policy: Redirect HTTP to HTTPS

Route 53 points the hostname to the CloudFront distribution using an alias record. CloudFront becomes the HTTP-facing service that issues the redirect.

This is often a good choice when you are already serving the site through CloudFront and ACM.

Example: Simple Domain Redirect With S3 Website Hosting

For a straightforward redirect from one hostname to another, an S3 website bucket can be configured to redirect all requests.

That looks like:

  • create a bucket named after the redirecting hostname
  • enable static website hosting
  • configure "redirect requests" to the target HTTPS hostname
  • point Route 53 to the S3 website endpoint or a CloudFront distribution in front of it, depending on the architecture

This is simple, but it is best for basic site redirection rather than a general application ingress strategy.

Common Pitfalls

  • Expecting Route 53 to send an HTTP 301 or 302 response directly.
  • Confusing DNS routing with web-server behavior.
  • Pointing the domain correctly in Route 53 but never configuring the redirect at the HTTP layer.
  • Using an S3 redirect pattern when the application actually needs a full HTTPS frontend.
  • Forgetting that the redirecting service, not Route 53, must handle ports 80 and 443 correctly.

Summary

  • Route 53 cannot perform HTTP-to-HTTPS redirects on its own.
  • Use Route 53 to route the hostname to a service that can return an HTTP redirect.
  • CloudFront, an ALB, S3 website hosting, or your own web server are the usual solutions.
  • Route 53 handles DNS; the redirect must happen at the HTTP layer.
  • Choose the redirecting service based on whether you need a simple hostname redirect or a full application frontend.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.