Forum Discussion
Dec 04, 2015
Hi,
this would i.e. look like the following:when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"sitename1.domain.com" {
add the redirect link to "sitename.domain.com"
HTTP::redirect "https://sitename1.domain.com"
return
}
"sitename2.domain.com" {
if { [class match [IP::client_addr] equals India_Host_Networks] } {
HTTP::redirect " https://local.domain.com/stream/"
return
} else {
HTTP::redirect "https://sitename2.domain.com"
return
}
}
default {
add the default action you prefer ie "www.def.com"
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
return
}
}
}
From my perspective it is best practice to add a return after using HTTP::redirect or HTTP::response because it can be used only once in the context of HTTP_REQUEST.
Thanks, Stephan