Forum Discussion
Gortguy_105156
Aug 31, 2011Nimbostratus
Strange issue with "matches_regex" and case sensitivity
I'm a relative newbie to iRules, so please don't laugh if this is too simplistic.
I also have two environments, call them primary and test. I use essentially the same rule (copy/paste) for the two; they differ only by the pools they direct traffic to which is determined by the URI.
Here's the rule for the primary site:
when HTTP_REQUEST {
if {[HTTP::uri] matches_regex "/MyURIString" } {
pool alt_pool
} else {
pool main_pool}
}
The rule for the test site:
when HTTP_REQUEST {
if {[HTTP::uri] matches_regex "/MyURIString" } {
pool alttest_pool
} else {
pool maintest_pool}
}
The rule for the primary site works fine, regardless of the case of the URI.
ex: https://mysite.com/MyURIString/page.html = OK
https://mysite.com/MYURISTRING/page.html = OK
https://mysite.com/myuristring/page.html = OK
In the test site, however, the URL is case-sensitive:
ex: https://mytestsite.com/MyURIString/page.html = OK
https://mytestsite.com/myuristring/page.html = broken
Why would one rule require case-sensitivity while the other does not?
- Michael_YatesNimbostratusThere is a good write-up that covers case-sensitivity in the URL here: http://www.w3.org/TR/WD-html40-970708/htmlweb.html
- Gortguy_105156NimbostratusThey're all IIS on the back end, so I know that isn't the case.
- hooleylistCirrostratusYou should also consider using string functions instead of regexes if you can:
- naladar_65658AltostratusHey Gort,
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