Execute two If condition in one iRule -- sorry page
I am new to iRule and need help in creating a sorry page
Here is condition
I have two pool english and french. When the nodes in the English pool are offline then redirect to URL (example google.com). When the nodes in French pool are offline then redirect to URL (example yahoo.com). I don’t want to redirect both
Here is iRule
when HTTP_REQUEST {
if {[active_members english] == 0} {
HTTP::redirect "http://google.com"
}
if {[active_members french] == 0 } {
HTTP::redirect "http://yahoo.com/"
}
}
Here is the problem
If the English pool is offline then the request get redirected to google.com, but it also redirect the request to French to google.com.
Same is true other way around. If French pool is offline then it is redirected to yahoo.com, but the English pool also get redirected to yahoo.com
I want to redirect only if the condition is true for which-ever pool. E.g English or French.
Please help