Forum Discussion
Modify blank URI
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...
Hi Fready Ball,
You must use equals instead of starts_with.
if { [HTTP::uri] equals "/" } { HTTP::uri [string map {"/" "/user"} [HTTP::uri]] }
Hi Fready Ball,
You must use equals instead of starts_with.
if { [HTTP::uri] equals "/" } { HTTP::uri [string map {"/" "/user"} [HTTP::uri]] }
- Fready_BallNimbostratus
Hi eaa, many thanks for your quick response. I will be testing this morning.
- Fready_BallNimbostratus
added with elseif and works a treat... thanks again eaa.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com