Forum Discussion
DennisJann
Feb 15, 2019Nimbostratus
I had to remove the ";" after ";, but otherwise your iRule syntax works as expected for me.
You could try using
curl
to test against the IP address of your VIP to see if you get the desired behavior.
curl -iv -H "Host: domain.com" http:///
If it works, compare against the output of:
curl -iv http://domain.com/
While your iRule syntax isn't wrong, it could be re-written as:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"domain.com" -
"www.domain.com" -
"uat.domain.com" {
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]"
}
default {
pool default_pool
}
}
}