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 "/"}
{ HTTP::redirect "http://m.srwd32.com/mobile/" }
elseif
{$uri starts_with "/myaccountapi/myaccount"}
{ persist none
pool SRWD32-MYX }
else{ if {$uri starts_with "/mobile/auth" and $port != 443 }
{ HTTP::redirect "https://[HTTP::host][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]" } } }
there is some issue in this irule
how to change it
if $uri is / go to http://m.srwd32.com/mobile/
if $uri starts_with "/myaccountapi/myaccount go to pool SRWD32-MYX
if {$uri starts_with "/mobile/auth" and $port != 443 go to https://[HTTP::host][HTTP::uri]
for other go to pool SRWD32-STATIC
I know I have mixed up by the realation of if ,elseif,else,..xo if......
Help me ?