Forum Discussion
KT_271103
Aug 31, 2017Nimbostratus
Need irule to match case sensitive characters
Need Irule for matching Words of lower and caps. for instance, the name "abcd" is using in URI. Whoever hits URI with "abcd" either lower or upper case it should block webpage. for other URI the page...
Kai_Wilke
Aug 31, 2017MVP
Hi KT,
to ignore the case while comparing URIs you have to add a [string tolower $input] or [string toupper $input] to format the URI value into either lowercase or uppercase. Then compare the URI with either lowercase or uppercase formated values.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "abcd" } then {
HTTP::respond 403 content "Access denied..." "Content-Type" "text/html"
}
}
Note: In the example above the
syntax won't change the HTTP-request as is. The syntax will only use a lower case formating of your URI while comparing the URI value...[string tolower [HTTP::uri]]
Cheers, Kai
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