Forum Discussion
What_Lies_Bene1
Nov 29, 2012Cirrostratus
This should do it. It would be better to use ifs instead of switch but leaving it as is makes it more flexible if you want to expand the address ranges;
when HTTP_REQUEST {
if { ([HTTP::header exists "X-Forwarded-For"]) and ([string tolower [HTTP::uri]] equals "/wf") } {
switch -glob [HTTP::header values "X-Forwarded-For"] {
"10.3.*" {
HTTP::redirect "http://www.test.com/WF?sr=new"
return
}
}
}
elseif { ([HTTP::header exists "X-Forwarded-For"]) and ([string tolower [HTTP::uri]] contains "/wf/hp.me") } {
switch -glob [HTTP::header values "X-Forwarded-For"] {
"10.0*" {
HTTP::redirect "http://www.test.com/WF/H.me"
return
}
}
}
}