14-Oct-2020 10:00
I am using this to modify get request in F5 to real server.
if { [HTTP::uri] starts_with "/supervisor" } {
HTTP::uri [string map {"/supervisor" "/admin"} [HTTP::uri]]
}
and it works OK.
but i need to change the get request to /user but only if URI is blank.
so abc.com/ will send get abc.com/user
I have tried this...
if { [HTTP::uri] starts_with "/" } {
HTTP::uri [string map {"/" "/user"} [HTTP::uri]]
}
this kind of works as i see get abc.com/user but it then adds /user to all URI's, so abc.com/admin becomes abc.com/useradmin
so i only need to add /user if the URI is blank,
any help appreciated as going bonkers...
Solved! Go to Solution.
14-Oct-2020 10:09
Hi Fready Ball,
You must use equals instead of starts_with.
if { [HTTP::uri] equals "/" } {
HTTP::uri [string map {"/" "/user"} [HTTP::uri]]
}
14-Oct-2020 10:09
Hi Fready Ball,
You must use equals instead of starts_with.
if { [HTTP::uri] equals "/" } {
HTTP::uri [string map {"/" "/user"} [HTTP::uri]]
}
14-Oct-2020 22:24
Hi eaa, many thanks for your quick response. I will be testing this morning.
14-Oct-2020 23:42
added with elseif and works a treat... thanks again eaa.