Here's how you would check for the first case:
when HTTP_REQUEST {
if { ([HTTP::host] equals "test.com") &&
([HTTP::uri] equals "/") } {
HTTP::uri "/tcr"
}
}
-or- you could combine the strings and do a single comparison
when HTTP_REQUEST {
if { "[HTTP::host][HTTP::uri]" equals "test.com/" } {
HTTP::uri "/tcr"
}
}
I'm not sure what you are getting at with your last sentence? URI's are not resolved in DNS, only the hostname portion of the URI. So for
http://test.com and
http://test.com/tcr, the browser (or whatever client) would do a DNS lookup on test.com and send a HTTP request to that host.
-Joe