How Can I Redirect Multiple Domain Extensions to a .com Using ALB?

May 24, 2025 5 answers
Asked by CuriousCat42
I'm trying to set up a setup where multiple domain extensions like example.net, example.org, and example.de redirect to my main .com site using my load balancer. I already have a load balancer and certificates in place for all these domains. So, on my HTTPS listener (port 443), I tried setting up a listener rule for the HTTP host header like this: www.example.org redirects to HTTPS://example.com:443/#{path}#{query}. I know that apex domains can't use CNAMEs, which is why I've pointed www.example.org to example.com in Route 53. I have around 30 domain extensions, so I need some guidance on the best way to configure this. Any advice or recommendations would be appreciated!

Answers

TechieTom
If your domains are managed in Route 53, you can use alias records for the apex domain or any subdomains (like *.example.com). At the load balancer, you have two main options: 1. Forward all traffic to a target group that handles the redirection. 2. Itโ€™s better to set up redirect rules in the load balancer for all your domains to point to the main one. This way, your app wonโ€™t need to handle DNS, just focus on its core functions.
Reply to this answer
DNSGuru
If your apex DNS records are in Route 53, they can point to an ALB using 'alias' A records. Setting up listener rules on the ALB is the right way to manage all the different host headers you have, redirecting them to a common target or to your main URL.
Reply to this answer
NetworkNerd78
You can set your ALB listener rules to match multiple hostnames using an OR condition, which is pretty straightforward.
Reply to this answer
DevOpsDude
Consider using Lambda at the edge to handle request rewrites or redirects. It can give you some extra flexibility in managing traffic.
Reply to this answer
WebWizard99
Be sure to point all your host rules to the same target group. It simplifies the setup.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions