Forum Discussion
Cody_Conklin_17
Nimbostratus
Aug 11, 2005iRule variable match is case sensitive
I have an iRule that behaves normally:
if (http_uri starts_with "/authentication") {
use pool IIS_Pool_80
}
else if (http_uri starts_with "/certapp") {
use pool IIS_Pool_80
}
else if (http_uri starts_with "/lms") {
use pool IIS_Pool_80
}
else {
use pool beta.xyz.com
}
Unfortunately, it does not work if a user accidentally goes to the URI "/Authentication". How do a make the variable match be case insensitive? Regardless of whether a user types "/Authentication" or "/authentication", it should direct to IIS_Pool_80.
14 Replies
- hoolio
Cirrostratus
Hi cachis,
Are you running 4.x or 9.x/10.x? This thread is for 4.x. The "when HTTP_REQUEST {... format is for 9.x/10.x.
Aaron - Christopher_Ach
Nimbostratus
Hi thanks for the reply
I am running 9.x
Will this irule be ok?
class allowed_uris {
"/abc"
"/xyz"
"/efg" note efg is not in use at this time
}
rule r1 {
when HTTP_REQUEST {
if(tolower(http_uri) starts_with one of allowed_uris) {
if { [active_members ECS-Pool] >= 1 } {
pool ECS-Pool
}
}
}
}
Thanks for your help
I just like the way this was done and I did not want to use the if statements and as I need to ability to comment in and out "allowed_uris" i thought this was good
Thanks in advance
Chris - hoolio
Cirrostratus
It's close, but not exactly in 9.x format. You can use:when HTTP_REQUEST { Check if requested URI starts with an allowed URI if {[matchclass [string tolower [HTTP::uri]] starts_with $::allowed_uris]}{ if { [active_members ECS-Pool] >= 1 } { pool ECS-Pool } else { Take some action? } } else { Take some action? } }
Aaron - Christopher_Ach
Nimbostratus
Hi Aaron
Thanks for rehashing this into v9.x code.
I feel more comfortable with what you just wrote as its more familiar with what im used to seeing
Thanks for your help. Ill put this into the Lab environment tonight and test it out.
Chris
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
