Forum Discussion
iRule Issue
You are using strings as boolean expressions which is what is causing the error.
You could do something like this:
when HTTP_REQUEST {
if { [HTTP::host] contains "www.careers.philips.com"} {
HTTP::redirect "http://www.philips.com/about/careers"
} elseif { ([HTTP::host] contains "www.peopleclick.com") or
([HTTP::host] contains "eeosource.peopleclick.com") or
([HTTP::host] contains "eeoanalytics.peopleclick.com") or
([HTTP::host] contains "eeodiversity.peopleclick.com") or
([HTTP::host] contains "generator.peopleclick.com") or
([HTTP::host] contains "optimum.peopleclick.com") or
([HTTP::host] contains "secure.peopleclick.com") or
([HTTP::host] contains "strategichr.peopleclick.com") or
([HTTP::host] contains "www.itiliti.com") or
([HTTP::host] contains "www.eeosource.com") or
([HTTP::host] contains "www.eeosource.net") or
([HTTP::host] contains "www.eeosource.org") or
([HTTP::host] contains "elearning.peopleclick.com") } {
pool CorpWeb
} else {
pool ProdWeb
}
}
A couple of optimizations, you might use the "equals" command instead of "contains" unless, that is, you want to cover extensions to those domain names.
Also, I'd look into using the matchclass command instead of all those or's. You can create a String Data Group and you could consolidate all those "or's" into a single line. Search the forums for "matchclass" and you'll find some examples.
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
