you're close, but you're missing some brackets around your string tolower as well as the fact that it will never match if you've lowered the letters but are trying to match against an upper in your match string.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc" } {
HTTP::uri [string map {"/abc" ""} [HTTP::uri]]
pool <new pool>
}
}
### alternative
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc" } {
HTTP::uri [string range [HTTP::uri] 4 end]
pool <new pool>
}
}
I propose the alternative because it is ever-so-slightly faster per iteration:
% set uri /abc/?doc=9999&cont=1000
/abc/?doc=9999&cont=1000
% time { string range $uri 4 end} 100000
0.6844128599999999 microseconds per iteration
% time { string map {"/abc" ""} $uri} 100000
0.7239472299999999 microseconds per iteration