Forum Discussion
Robert_Sherrard
Nimbostratus
Apr 05, 2006Valid 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
1 Reply
- Derek_Nelson_10
Nimbostratus
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects