12-Aug-2020 05:33
Hi all
Im using my F5 BIGIP (v14) as reverse proxy to publish some websites by using local traffic policies.
But i need to perform a URL rewriting. To be specific, i need to strip a string from the URI path.
When applied as IRule it works correctly as I want:
when HTTP_REQUEST { if { [string tolower [HTTP::uri] ] starts_with "/path1" } { HTTP::uri [string map {"/path1/" "/"} [HTTP::uri]] } }
But when using local traffic policy it does not work as expected:
Replace - HTTP Uri - PATH ... with value... tcl:HTTP::uri [string map {"/path1/" "/"} [HTTP::uri]]
Am i doing something wrong? What would be the correct way?
PS: I want replace path1 with an empty string
Thanks all!
15-Aug-2020 15:05
Hi mika,
You shouldn't add "HTTP::uri" command after "tcl:"
tcl:[string map {"/path1/" "/"} [HTTP::path]]
19-May-2023 01:49
Hi Enes,
can i instert "/path" at the begining of the path, with path variable?
for example
https://www.url.it/variable/variable.. -> https://www.url.it/path/variable/variable
thanks,
Arlind