Forum Discussion

Shlairshe_84486's avatar
Shlairshe_84486
Icon for Nimbostratus rankNimbostratus
Apr 16, 2014

redirecting for url/uri to url/uri

Hi, I have a question regarding redirecting and I am not sure if it is supported on the bigIP. I am trying to send a request from a user to the eg site http://lions.dev.tmp.com/bids, so that if the user types http://lions.dev.tmp.com/bids , this user will be sent or redirected to http://tigers.dev.tmp.com/bids, is this possible. I tried multiple combinations and came up with the following but it does not account for the domain/uri, really need assistance with this. when I type http://lions.dev.tmp.com i get redirected to http://tigers.dev.tmp.com, but I want to be able to type http://lions.dev.tmp.com/bids and get redirected to http://tigers.dev.tmp.com/bids (is this possible on the bigip)

 

when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { set newuri "/bids" HTTP::redirect http://tigers.dev.tmp.com/bids } }

 

4 Replies

  • Possible indeed:

    when HTTP_REQUEST { 
     if {[string tolower [HTTP::host]] equals "lions.dev.tmp.com" and [string tolower [HTTP::uri]] equals "/bids" } { 
      HTTP::redirect "https://tigers.dev.tmp.com/bids" 
      } 
    }