Forum Discussion
Combine redirect iRule doesn't work
Hi All,
I have two irules in one of my virtual server and run perfectly. I tried to merge the two irule but no luck, could someone review my merge irule? See below irule.
1st irule: when HTTP_REQUEST {
if { [HTTP::host] equals "outlook.kw.com.xy"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
2nd iRule: when HTTP_REQUEST {
if { [HTTP::host] equals "mail.kw.com.xy"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
Merged iRule (doesn't work): when HTTP_REQUEST {
if { [HTTP::host] equals "outlook.kw.com.xy" && [HTTP::host] equals "mail.kw.com.xy"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
Thanks and regards,
1 Reply
- Stefan_Klotz
Cumulonimbus
Hi Albert,
you combined your two if-statements with AND (&&), which will never be true. You need to use or (||). Something like this:
when HTTP_REQUEST { if { ([HTTP::host] equals "outlook.kw.com.xy") or ([HTTP::host] equals "mail.kw.com.xy") } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }Ciao Stefan 🙂
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com