Forum Discussion
Deb_Allen_18
May 18, 2005Historic F5 Account
matchclass syntax / allowed operators
is this valid syntax for matchclass?
[matchclass $inbound_uri starts_with $::uri_redirects]
I'm trying to redirect based on a variable length leading directory in the URI string.
...
Colin_Walker_12
May 18, 2005Historic F5 Account
Deb,
Yes, the "starts_with" operator is legitimate in conjunction with "matchclass". This should work the way you are looking for, much like the "contains" operator. The difference being that it will attempt to match from the beginning of the uri when comparing it to each member of the class. "contains" would match the member string anywhere in the uri.
I.E, assuming the uri_redirects class contains a member defined as "/ambulance":
when HTTP_REQUEST {
set inbound_uri [string tolower [HTTP::uri]]
[matchclass $inbound_uri starts_with $::uri_redirects]
would match
http:///ambulance/
but not
http:////ambulance/
Using the same rule with the "contains" operator would match both, which can cause unwanted behavior in some cases.
Hopefully this answers your question.
-CW
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
