Forum Discussion
Trouble with Exclusion URI iRule
- May 27, 2014
Your latest iRule contains a capital letter in your match string. It'll never match since you are converting to lower case before comparison.
Can you elaborate on what you mean or need when you say you can only enter one directory? I re-read your previous comment that said,
"i ran into another issue though. For some reason, i can only enter one directory into the "/uri1". EX: If i enter starts_with "/helpdesk" Then anything behind that directory won't get APM as expected. If i enter "/helpdesk/webobjects" i would expect everything behind that directory not to get APM as long as there was no session cookie. For some reason, it is still getting APM."
Are you trying to match multiple URI prefixes and for each one check for the cookie? or are you just trying to do one single URI prefix with a subdirectory under it?
If you just want one URI prefix but to allow any characters to the right of that URI prefix to be included then the key is the trailing asterisk and using a -glob in a switch
If you just want to be able to check multiple different URI prefixes then you can just add as statements into the switch like below
switch -glob [string tolower [HTTP::uri]] {
/uri1* { if { [HTTP::cookie exists MRHSession] } {
ACCESS::enable
return
} else {
ACCESS::disable
}
}
/helpdesk* { if { [HTTP::cookie exists MRHSession] } {
ACCESS::enable
return
} else {
ACCESS::disable
}
}
/blah* { if { [HTTP::cookie exists MRHSession] } {
ACCESS::enable
return
} else {
ACCESS::disable
}
}
default {
ACCESS::disable
return
}
}
FYI the default block is what happens if the inbound URI does not match any of your URI prefix's. A return will just conclude the irule and you might want to set a default ACCESS action to be either disable or enable.
If none of this is what you really are trying to do then I think more explanation is needed on your goal
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