Forum Discussion
Andy_McGrath
Feb 07, 2018Cumulonimbus
Careful you do not direct them to the logon page all the time and i would look at using switch instead of if elseif but put an if as a top level trigger, only do this if the URI starts with "/ap" then just strip the "/apx" from the uri.
Think the following should do the job:
Allow server selection via uri
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if {$uri eq "/"} {
HTTP::uri "/wfc/logon"
} elseif {$uri starts_with "/ap"} {
switch -glob $uri {
"/ap1" {
pool Kronos member 192.168.1.121 80
HTTP::uri [string map {"/ap1" ""} $uri]
}
"/ap2" {
pool Kronos member 192.168.1.122 80
HTTP::uri [string map {"/ap2" ""} $uri]
}
"/ap3" {
pool Kronos member 192.168.1.123 80
HTTP::uri [string map {"/ap3" ""} $uri]
}
}
}
}