Forum Discussion
Skuba_85554
Nimbostratus
Oct 13, 2010is this line correct?!
hi everyone
could you confirm whether line 2 is correct? it only used to contain "www.abc.com" but i've added the "or" statement and i'm not sure if it's entirely correct...
------...
Ben_95489
Nimbostratus
Oct 13, 2010Hey Skuba,
I believe you'll need to actually define the whole criteria again. For example:
if { ([string tolower [HTTP::host]] starts_with "www.abc.com") or ([string tolower [HTTP::host]] starts_with "www.def.com")} {
It probably isn't critical, but you might want to perform the tolower to make a variable instead of performing the operation twice
set hostval [string tolower [HTTP::host]]
if { ($hostval starts_with "www.abc.com") or ($hostval starts_with "www.def.com")} {
I believe that the example you used would do is evaluate if "www.def.com" is true - which it should always be (i.e. similar to a "while true" statement). There are some more details on the 'or' operator here, too: http://devcentral.f5.com/wiki/default.aspx/iRules/or.html
// Ben
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