This should work for you.
when RULE_INIT {
set ::whichone 0
}
when HTTP_REQUEST {
switch $::whichone {
0 {
HTTP::redirect "http://Server1/blah"
}
1 {
HTTP::redirect "http://Server2/blah"
}
}
set ::whichone [expr ! $::whichone]
}
Basically it's setting a global variable and toggles it between 0 and 1 on each http request. Then, depending on the current value it issues the appropriate redirect.
Or, you could do the same without the expr command and using a default case to avoid a second comparison on the value 1.
when RULE_INIT {
set ::whichone 0
}
when HTTP_REQUEST {
switch $::whichone {
0 {
HTTP::redirect "http://Server1/blah"
set ::whichone 1
}
default {
HTTP::redirect "http://Server2/blah"
set ::whichone 0
}
}
}
Hope this helps...
-Joe