First thing I see is that in your data group, the key value is probably never going to be triggered that way. You'll need it to be
mysite.com
or
www.mysite.com
, which is what the
HTTP::host
value will be.
Secondly, I'd change the event up a little bit. I assume you're using
event disable
so no other iRules will run on the connection. That command will disable the even for future requests on the same connection as well, so you may want to do one of 2 things. Either close the connection and force a new one, or re-enable the event before the response goes out.
Option 1: Close the connection
when HTTP_REQUEST {
set artifactid [class match -value [string tolower [HTTP::host]] contains my_apology_dg ]
if {( $artifactid ne "") and ([active_members my_web_pool] < 1) }{
HTTP::respond 302 Location $artifactid "Connection" "Close"
Disable all other iRules for this connections
event disable all
}
}
Option 2: Re-Enable the event
when HTTP_REQUEST {
set artifactid [class match -value [string tolower [HTTP::host]] contains my_apology_dg ]
if {( $artifactid ne "") and ([active_members my_web_pool] < 1) }{
HTTP::redirect $artifactid
event HTTP_REQUEST disable
}
}
when HTTP_RESPONSE_RELEASE {
event HTTP_REQUEST enable
}
If you wanna see the event order on a connection, here's an article describing it, to get an idea of the flow.