Just for clarity.
Note the difference between:
if { [string first -nocase [HTTP::uri] "foo"] } {...}
which should really be:
if { [string first -nocase "foo" [HTTP::uri] ] } {...}
From TCL manual:
string first string1 string2 ?startIndex?
Search string2 for a sequence of characters that exactly match the characters in string1. If found, return the index of the first character in the first such match within string2. If not found, return -1. If startIndex is specified (in any of the forms accepted by the index method), then the search is constrained to start with the character in string2 specified by the index.
I am just trying to avoid some potential confusion for future readers of this thread.