Forum Discussion
Chris_G_Davis_1
Nimbostratus
Nov 17, 2008URI iRule Logic
Help!
Attempting to write an iRule that matches multiple uri's. If uri matches it's sent to the appropriate pool, if not but partially right it gets rewritten correctly and sent to appr...
hwidjaja_37598
Altostratus
Nov 17, 2008Try this:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/cce-presentation-kiosk-a3/live.html"} {
pool A3-KCI
} elseif { [HTTP::uri] ends_with "/cce-presentation-kiosk-a3/" } {
log local0. "URI not complete; rewrittinghttp://[HTTP::host]/[HTTP::uri]"
HTTP::uri "/cce-presentation-kiosk-a3/live.html"
pool A3-KCI
} elseif { [HTTP::uri] equals "/cce-presentation-kiosk-fv/live.html"} {
pool FV-KCI
} elseif { [HTTP::uri] ends_with "/cce-presentation-kiosk-fv/" } {
log local0. "URI not complete; rewrittinghttp://[HTTP::host]/[HTTP::uri]"
HTTP::uri "/cce-presentation-kiosk-fv/live.html"
pool FV-KCI
} else {
log local0. "URI doesn't match; rejecting connection http://[HTTP::host]/[HTTP::uri]"
reject
}
}
I found some syntax errors in if then elseif block.
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