
How can I use an Application Load Balancer to redirect one domain to another?
The Application Load Balancer service supports redirection of domain names as well as redirection from HTTP to HTTPS. If you have a domain that points to an Application Load Balancer, then use the Application Load Balancer to configure the domain.
Published Oct 28, 2024
If you use an Application Load Balancer as part of your configuration, then you can use it to redirect one domain to another:
- On the navigation pane, under Load Balancing, choose Load Balancers.
- Select your load balancer, and then choose Listeners.
- Choose View/edit rules for the load balancer listener that you want to use.
- Choose the Add rule icon (the plus sign).
- Choose Insert Rule.
- Choose Add condition.
- In the conditions section (IF), choose Add condition. Then, complete the following steps:
Choose Host header, and then enter your hostname (for example, example.com).
To save, choose the checkmark icon. - In the actions section (THEN), choose Add action. Then, complete the following steps:
Choose Redirect to.
Specify the protocol and port, as your use case requires.
Change Original host, path, query to Custom host, path, query.
For Host, enter example2.com.
For Path and Query, keep the default values (unless your use case requires you to change them).
Set the Response to HTTP 301 "Permanently moved" or HTTP 302 "Found".
To save, choose the checkmark icon.
The THEN section now appears:
Redirect to https://example2.com:443/#{path}?#{query}
Status code: HTTP_301 - Choose Save.