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!
3 Answers
You can set your ALB listener rules to match multiple hostnames using an OR condition, which is pretty straightforward.
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.
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.
Related Questions
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads