Forum Discussion

Joe_48617's avatar
Joe_48617
Icon for Nimbostratus rankNimbostratus
Feb 21, 2008

Adventures with findstr

I'm trying to get this rule to work...

 

 

when HTTP_REQUEST {

 

if {[matchclass [HTTP::uri] ends_with $::unmc_extends] or

 

[matchclass [HTTP::method] equals $::unmc_methods] or

 

[matchclass [HTTP::uri] contains $::unmc_sql] or

 

[matchclass [IP::client_addr] equals $::unmc_restrict_ips]}{

 

discard

 

} elseif {

 

([findstr[HTTP::uri] "." 0 0] eq ".") or

 

([HTTP::uri] ends_with "/") or

 

([HTTP::uri] contains "unmcintranet")}{

 

pool unmc-intranet-proxy

 

} elseif {[HTTP::uri] contains "google"}{

 

HTTP::redirect "http://[HTTP::host][HTTP::uri]&restrict=unmcintranet"

 

} else {

 

HTTP::redirect "http://[HTTP::host][HTTP::uri]/"

 

}

 

}

 

 

It works more or less if I take out the findstr line problem is without the findstr line a trailing / gets appended to all urls not just directory requests...

 

 

from what I understand from the findstr docs it appears that I have the command defined correctly to determine if there is a . in the uri which would stop the irule from appending a / to the end of a .html or any other uri that has a . in it.

 

 

Any pointers or guidance would be most appreciated.

 

 

Thanks

 

 

Joe
No RepliesBe the first to reply