Forum Discussion
Leslie_South_55
Nimbostratus
Oct 19, 2007findclass AND external class AND wildcards
I am using an external class file to do URI redirects, when using speciffic URI matching it works fine: when HTTP_REQUEST {
log local0. "Uri is [HTTP::uri]"
set NewURI [findclass [HTTP::uri]...
hoolio
Cirrostratus
Oct 22, 2007I don't think you can use wildcards with findclass. One option would be to loop through the class using 'foreach line $::class' and do a string comparison using 'starts_with' or 'string match' against the element of the line.
Here's a rough, untested example:
...
foreach line $::class {
if {[HTTP::path] starts_with [getfield $line " " 1]}{
HTTP::redirect "http://[HTTP::host][getfield $line " " 2]"
}
}Aaron
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
