Forum Discussion

ken_wolff_10732's avatar
ken_wolff_10732
Icon for Nimbostratus rankNimbostratus
May 23, 2007

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

3 Replies

  • 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