Forum Discussion
The_Bhattman
Dec 23, 2010Nimbostratus
Hi Jamesy,
The examples you presented are not redirects, because redirects, specifically HTTP redirects is forcing the client's browser to go to a new link or URL. I think what you are refering to is send then the HTTP request to a specific pool based on certain conditions.
So let's start with following pseudo code
IF POOL A is unavailable {
then go to Pool B
ELSE
Go to POOL A
Now there is a command called active_members (http://devcentral.f5.com/wiki/default.aspx/iRules/active_members.html)
When executed this command returns the number of members in a pool So if all the servers in a pool is unavailable then it should return a zero.
Using one of your examples
when HTTP_REQUEST {
if { [active_members pool1] > 0 } {
if { [HTTP::uri] starts_with "/login-test" } {
pool Pool1
}
} else {
pool sorry_page_pool
}
}
I hope this helps
Bhattman