Haproxy Prefix redirect with regex match path

Hi all,

I’m trying to redirect domain to another with same path values. What i have tried is given below.
HA-Proxy version: 2.0.13-2 2020/04/01

In my frontend:
http-request redirect prefix http://example.test.com if { hdr(host) -i https://test.com } { path_reg /[a-z0-9_.-]{0,5} }

This is what i’m trying to achieve
When user access https://test.com/7hjl3 it should redirect to http://example.test.com/7hjl3

Any help with this would be great.

1 Like

hdr(host) is test.com. not https://test.com.