Select Language:
If you’re working with AWS Application Load Balancer (ALB) and trying to modify URLs during redirects, you might notice some limitations. This isn’t a bug but a normal part of how ALB works. According to AWS guidelines, transforms that modify the URL’s path or query string can only be used when forwarding requests to targets, not when sending redirects.
When you set up a redirect, the ALB uses the original request URL to create the redirect. However, the transform feature is meant to update the URL before it’s sent to your backend service, not to change the URL in a redirect response. This means you can’t use transforms to change the protocol, port, or other parts of the URL during a redirect.
Here are a couple of solutions for your situation:
First, if possible, switch to a forward action instead of a redirect. This allows you to apply your transformations before the request reaches your backend. For example, you can modify the path or query string as needed, giving you more control over how requests are processed.
Second, if you need to perform redirects, set up multiple listener rules with specific path patterns that match your old URLs. Each rule can redirect to a new path explicitly, without relying on transforms. This method is more manual but keeps your redirects clear and functional.
Remember, this limitation is part of the current ALB design and isn’t expected to be fixed soon. For more details, you can visit the AWS documentation on listener rule transforms and control the load balancer rules through the official AWS Control Tower resources.




