Appending to a request

I think this is simple, but I’m not having any luck so far. Running 9.3 on our LTMs. When I get a request for http://test.com, I need to append /tcr to the end so that http://test.com becomes http://test.com/tcr. FYI-http://test.com resolves in dns but http://test.com/tcr does not. Thanks, Ken

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

Great. This worked fine. Thanks, Ken

My Pleasure!

-Joe