Forum Discussion
Robert_47833
May 12, 2011Altostratus
if,elseif,else, need help
when HTTP_REQUEST {
set uri [HTTP::path]
set queryString [URI::query [HTTP::uri]]
set port [TCP::local_port]
set srcIP [IP::client_addr]
if {$uri equals "/"}
{...
Michael_Yates
May 12, 2011Nimbostratus
Hi jucao,
Try this and see if it works for what you are needing:
when HTTP_REQUEST {
switch -glob [ string tolower [HTTP::uri]] {
"/" { HTTP::redirect "http://m.srwd32.com/mobile/" }
"/myaccountapi/myaccount*" { persist none; pool SRWD32-MYX }
}
if { [[TCP::local_port clientside] != 443] && [[HTTP::uri] starts_with "/mobile/auth"] } {
HTTP::redirect "https://[getfield [HTTP::host] ":" 1]/[HTTP::uri]"
log local0. "here i am 1 [HTTP::uri]"
}
else {
persist none
SSL::disable serverside
pool SRWD32-STATIC
log local0. "here i am 2 [HTTP::uri]"
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects