when HTTP_REQUEST {
set debug 1
if {[HTTP::cookie exists "SelectedCountryCode"]} {
set country [HTTP::cookie "SelectedCountryCode"]
if {$debug} { log local0. "SelectedCountryCode = [HTTP::cookie SelectedCountryCode ]" }
} else {
set country [whereis [IP::client_addr] country]
}
if {$debug} { log local0. "Country is $country" }
switch $country {
PA { set redirect http://www.testdomain.com/nsurvey}
US { set redirect http://www.testdomain.com/nsurvey}
CA { set redirect http://www.google.com}
AU { set redirect http://www.ctstestdomain.com/nsurvey}
GB { set redirect http://www.testdomain.com/nsurvey}
default {
if {$debug} { log local0. "Unmatched country was $country" }
set redirect http://www.testdomain.com
}
}
if {$debug} { log local0. "Redirected to $redirect" }
HTTP::redirect $redirect
}
I didn't see any data classes listed so took them out for this code. Test and check the logging to validate the results. Then you can add the classes back in. Is the last pool command in your code meant to be a redirect? The pool name looks like a website name. You can turn off logging by setting debug 0 on the second line.
Kevin (Jarvil)