Strip all expressions after domain name and redirect to domain only


Hi, I have the following currently to redirect all traffic from to

acl host_redir_domain_com hdr(Host) -i
redirect prefix code 301 if host_redir_domain_com

This does the redirect just fine but if I pass the url in my browser then it also redirects to which does not exist in the new domain. I want anything after the / to be stripped away and only redirect to the new root domain (ie: only)

Could anyone please help me in achieving this. Your help is much appreciated.

(HA-Proxy version 1.5.18)



I figured it out now, you can use the ‘location’ directive to pass on to the exact location. ie:

http-request redirect location code 301

as simple as that. Thanx