Forum Discussion

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

HTTP Referer

Dear Dev Team,

 

The iRule is working fine. But I want to get the requests to be forwarded to "Pool2" if the user who is coming from the subnet(9.3*) and the HTTP Referer value is "http://www.test.com/UK"

 

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

 

}

 

}

 

 

Could you pls suggest?

 

2 Replies

  • But I want to get the requests to be forwarded to "Pool2" if the user who is coming from the subnet(9.3*) and the HTTP Referer value is "http://www.test.com/UK"have you tried to add if-statement (to check referer) inside 9.3 switch case?