Valid iRule

Does what I have here appear to be a valid I iRule?

when HTTP_REQUEST {

if { [HTTP::host] contains “STG-CNBCVIDEO” } {

pool STG-CNBCVIDEO_80

} elseif { [HTTP::host] contains “somethingelse” } {

pool somethingelse

} elseif { [HTTP::host] contains “somethingelse2” } {

pool somethingelse2

} else {

discard

}

}

Is there anything I can do, besides discard, i.e. a catch all pool that could have a default message… something besides just dropping a request?

Rob

Hi Rob.

You could always try a:

HTTP::redirect “http://mysite.com/somepage.html”

instead of a discard…

I had problems with the elseif command on 9.1.1 but I’m only new to iRules… I use (at present)

if {condition}{

statement(s)

}

else {

if {condition2}{

second-statements

}

}

Maybe someone else can comment on elseif?

Cheers,

- Derek