Forum Discussion
Dec 04, 2015
It would look like the following to stick to your example with the string "media" contained in the hostname:
}
"*media*" {
if { [class match [IP::client_addr] equals India_Host_Networks] } {
HTTP::redirect " https://InhydNimble1.domain.com[HTTP::uri]"
return
} else {
HTTP::redirect " https://media.domain.com[HTTP::uri]"
return
}
}
"*change*" {
HTTP::redirect "http://site.domain.com/cm"
return
}
"*empcon*" {
HTTP::redirect "http://site.domain.com/?cmd=login"
return
}
"*im*" {
HTTP::redirect "https://site.domain.com/IntegratedLogin.asp"
return
}
By adding the
[HTTP::uri]
to the redirect you will preserve the initial path including variables.
There is no need for an additional hostname evaluation. So I removed it.
(It will be evaluated by the switch command and match the "*media*" as you are using the globbing option.)