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 23, 2007Can you try formatting the file with just one pair of double quotes per line?
"/test/google/ http://www.google.com"
Also, if you're using the starts_with command to test the URI, the first field in the class should always start with a forward slash.
Lastly, I don't think the example I gave using starts_with wouldn't allow you to use an asterisk in the URI (the first field of the class's lines). It would in effect include an asterisk at the end of every URI. If you want to be able to apply a wildcard to only some URIs and in different positions, I think you'd have to use the string match command:
original:
if {[HTTP::path] starts_with [getfield $line " " 1]}{
Updated:
if {[string match [getfield $line " " 1] [HTTP::path]]}{
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
