Forum Discussion

muzammil_88686's avatar
muzammil_88686
Icon for Nimbostratus rankNimbostratus
Jun 05, 2013

Redirection iRule is going in loop

Dear Team,

 

We have the below two iRules.

 

===

 

when HTTP_REQUEST {

 

if {([HTTP::header exists "X-Forwarded-For"]) and ([string tolower [HTTP::uri]] equals "/maxi/homepage.do")} {

 

switch -glob [HTTP::header values "X-Forwarded-For"] {

 

"9.23*" {

 

HTTP::redirect "http://www.test.com/MaXi/homePage.do?src=US"

 

return

 

}

 

"9.3*" {

 

HTTP::redirect "http://www.test.com/UK"

 

return

 

}

 

"9.102.*" {

 

HTTP::redirect "http://www.test.com/MaXi/homePage.do?src=US"

 

return

 

}

 

}

 

}

 

elseif {[string tolower [HTTP::uri]] starts_with "/maxi"} {

 

pool Pool2

 

}

 

}

 

===

 

when HTTP_REQUEST priority 10 {

 

switch -glob [HTTP::uri] {

 

"/MaXi*" { pool Pool2}

 

default { pool Pool1 }

 

 

}

 

}

 

===

 

Redirection for 9.23* and 9.102.* are working fine without any issues.

 

Even for the 9.3* redirection is working fine and the user is getting the page "http://www.test.com/UK" successfully. But there is tab (URL "http://www.test.com/MaXi/homePage.do") on the page when he clicks it is taking him to same page i.e "http://www.test.com/UK"

 

 

Could you pls help and sugest if anything is wrong on the iRules?