Forum Discussion

William_Perrie_'s avatar
William_Perrie_
Icon for Nimbostratus rankNimbostratus
Sep 19, 2006

http insert or rewite request

Is it possible to insert/rewite an http get so

 

 

http://abc.site.com/test/Invtest

 

becomes

 

 

http://abc.site.com/test1/inv/op/adapter_plain?namespace=urn%3Asite%2Ecom%3AAIT%3AInventoryCheck&interface=AITInventoryCheck_Abs

 

 

 

My appologies, but I posted this earlier and that login account appears to be corrupt

 

 

The extended URL is failing at the customer site due to a limition they set on their URL filtering.

1 Reply

  • The answer is yes. The question is how you want to do it. If you want the change to show up in the clients browser, then you will have to issue an HTTP::redirect

    when HTTP_REQUEST {
      if { [HTTP::uri] eq "/test/Invtest" } {
        HTTP::redirect "http://[HTTP::host]/test1/inv/op/adapter_plain?namespace=urn%3Asite%2Ecom%3AAIT%3AInventoryCheck&interface=AITInventoryCheck_Abs"
      }
    }

    This will send a redirect request to the client brower and a new connection will be made to the new url.

    But, if you just want to change what the backend web server sees and are not concerned that the client sees the change, you can just modify the HTTP::uri before sending it to the backend server

    when HTTP_REQUEST {
      if { [HTTP::uri] eq "/test/Invtest" } {
        HTTP::uri "/test1/inv/op/adapter_plain?namespace=urn%3Asite%2Ecom%3AAIT%3AInventoryCheck&interface=AITInventoryCheck_Abs"
      }
    }

    Hope this helps...

    -Joe