HAPROXY add a slash to url on redirect

I have to redirect an url to another one witch is very long and hard to retain

HA PROXY add a ‘’/‘’ on the redirect and so the site could be reach but some personnalisation of the page isn’t ok

the instruction is
http-request redirect code 301 drop-query append-slash prefix https://somefqdn.com/Login.aspx?OrgId=xxxxxxxxx if redirect_urlprojet

url redirect has got a “/” at the end
in order to work correctly the url must be https://somefqdn.com/Login.aspx?OrgId=xxxxxxxxx

How can i modify this in order to reach the good page ?

Don’t use append-slash if you don’t want that.

I have originaly try this without drop-query append-slash
but the result is the same
http-request redirect code 301 prefix https://somefqdn.com/Login.aspx?OrgId=xxxxxxxxx if redirect_urlprojet

Right, you should use location instead of prefix, because https://somefqdn.com/Login.aspx?OrgId=xxxxxxxxx is not a prefix but a complete URI:

lukas@dev:~$ sudo grep redirect cert/haproxy-redirect.cfg
        http-request redirect code 301 location https://somefqdn.com/Login.aspx?OrgId=xxxxxxxxx
lukas@dev:~$ curl -I
HTTP/1.1 301 Moved Permanently
content-length: 0
location: https://somefqdn.com/Login.aspx?OrgId=xxxxxxxxx



i tried this
but it didn’t work

when i use curl to try to have the same example of your sintaxt

I have already the good location without ‘’/‘’

curl -k -I https://somefqdn.com
HTTP/1.1 301 Moved Permanently
content-length: 0
location: https://somefqnd2.com/xxxxxx/Pages/Service/Login.aspx?OrgId=xxxxxxx

so it’s the same result with http redirect code 301 prefix
‘/’ is added on the url passed to the browser

I don’t understand what you are trying to say, but your output shows no trailing slash.

exact redirection is OK
the web page is screening but css isn’t apply because of the browser add ‘’/‘’ at the end of the url