Forum Discussion
kmtmt_51646
Nov 19, 2012Nimbostratus
Hi hoolio,
Thank you for your reply!
And let me correct what I wrote
>a) http://www.example.com/test
>b) http://www.example.com/test/index.html
>c) http://www.example.com/directory/test/index.html
>d) http://www.example.com/testing/index.html
-> a) and b) is correct URL to be sent to pool-true, but c) and d) are false, which is to be sent to pool-false.
as you advise, I can put "/test" and "/test/" into 1 datagroup, but then I can use either "equals" or "start_with", and if I do "start_with /test || /test/", above URL d) will be false-positive...
trimright sounds a very nice idea, but again, I cannot differentiate b) and d) .
So I trimright datagroup as follows. Didn't get any error, but it seems not working to trimright datagroup...
=========
when HTTP_REQUEST {
if { [class match -- [HTTP::uri] starts_with testgroup2] || [class match -- [HTTP::uri] equals [string trimright "testgroup2" "/"]]}{
pool pool-true
} else {
=========
I guess I should do with 2 datagroups...
Thank you anyway!
kmtmt