Forum Discussion
cjunior
Apr 14, 2015Nacreous
Try:
when HTTP_REQUEST {
log local0. "requested host: [HTTP::host]"
if { [string tolower [HTTP::host]] equals "www.example.ca" } {
log local0. "Sending HTTP 302 redirection"
HTTP::respond 302 Location "https://example.ca"
} else {
log local0. "Do nothing for current request"
}
}
and tail the LTM log on ssh Linux:
tail -f /var/log/ltm
Apr 14 14:06:08 bigipbeta info tmm1[15283]: Rule /Common/rule_to_redirect : requested host: www.example.ca
Apr 14 14:06:08 bigipbeta info tmm1[15283]: Rule /Common/rule_to_redirect : sending HTTP 302 redirection