Forum Discussion
Skuba_85554
Nimbostratus
Jun 05, 2009is this irule ok?!
i've used the irule editor to check but it doesn't seem to be working correctly i.e. www.mainsite.com doesn't work but www.mainsite.com/subsite does work!...
when HTTP_REQUEST {
...
Colin_Walker_12
Jun 05, 2009Historic F5 Account
You were close with your initial attempt. Whenever you're using a logical operator like or, you have to repeat the comparison operator as well. Like this:
when HTTP_REQUEST {
if { ([string tolower [HTTP::uri]] starts_with "/subsite") or ([string tolower [HTTP::uri]] starts_with "/subsites")} {
pool subsite_pool
} else {
pool main_pool
}
}
Realistically though, starts_with /subsite includes starts_with /subsites anyway, so you should only need the one comparison.
So really, this should get you there:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/subsite"} {
pool subsite_pool
} else {
pool main_pool
}
}
hth,
Colin
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