Changing the request based on the domain begining

We have an application where we expect the request in the form Where “name” is the customer ID and there could be 100’s of possible names (I hope…)

The customers wish to connect to a vanity URL of

To date I have used a redirect with:
http-request set-var(req.subdomain) req.hdr(host),lower,regsub($,) if { hdr_end(host) -i }
http-request redirect code 302 location[var(req.subdomain)] if is_app

This works but the end user has the url and while it works I have complaints

How would you solve this :slight_smile:


Isn’t rewriting a better option than redirect? Something like

http-request set-path /app/?db=%[var(req.subdomain)] if is_app