Forum Discussion
PeteWhite
Oct 17, 2014Employee
Sorry, just looked at the back and it strikes me that you're only ever going to get as far as the else on the first if statement. Presumably you want to use nested if statements instead:
when HTTP_REQUEST {
if { ([HTTP::uri] contains "CA") } {
if { ([IP::addr [IP::client_addr] equals 10.10.0.0/21]) }
{
HTTP::redirect "https://public.example.com"
} else {
HTTP::redirect "https://inside.example.com"
}
}
if { ([HTTP::uri] contains "MTN") {
{
if { ([IP::addr [IP::client_addr] equals 10.10.0.0/21]) }
{
HTTP::redirect "https://public.example.com"
} else {
HTTP::redirect "https://inside.example.com"
}
}
if { ([HTTP::uri] contains "UK") }
{
if {([IP::addr [IP::client_addr] equals 172.30.144.0/22]) }
{
HTTP::redirect "https://public.example.com"
} else {
HTTP::redirect "https://inside.example.com"
}
}
discard
}