Reputation: 53
I need to redirect my link from HTTP to HTTPS using route 53. I am running my app on heroku and using the domain from route 53.
Is there a way to redirect all HTTP links to HTTPS without meddling with the server-side code?
For example, using example.com, when going to http://example.com, I would want it to redirect to https://example.com. There is no need to redirect it to https://www.example.com.
Upvotes: 0
Views: 1565
Reputation: 35238
Route 53 is a DNS service only for mapping domains to resolvable records, redirects are not part of the service provided here.
If you're interested in performing a HTTP to HTTPS redirect without having to apply any configurations or code changes within your application there a couple of services that can perform the redirect for you. However, as you're using Heroku an Application Load Balancer would not be applicable.
CloudFront is AWS managed CDN service, by adding this in front of your application you can enable HTTP to HTTPS redirect in the distribution configuration. You would then use an Alias record in Route 53 to resolve your domain to the CloudFront CNAME you're provided.
In addition for general context the below option can also be used when the host is in AWS, or the ALB can communicate to it via a private IP address.
For AWS based hosts (or IP based hosts) AWS can also perform redirects via a Application Load Balancer which supports any complex redirect rules, including the ability to redirect HTTP to HTTPS. Application hosts would be added to the ALB via a target group and would become private to avoid any direct communication.
Upvotes: 1
Reputation: 200988
Route53 isn't involved in serving the request, it's just involved in the DNS resolution, so no it's not possible.
Upvotes: 1