Forum Discussion

Wendi_Goulette_'s avatar
Wendi_Goulette_
Icon for Nimbostratus rankNimbostratus
Jun 10, 2014
Solved

ProxyPass 302 redirect possible?

Hello, I just implemented the ProxyPass irule for some headerrewrites and it's working beautifully. The only thing is my customer wants me to also do a redirect if the URL matches a certain string. ...
  • Kevin_Davies_40's avatar
    Jun 11, 2014

    Proxypass does not include redirect functionality that you can use for this. It only modifies traffic on the way to the server.

    Your better off adding an iRule to do it.

    when HTTP_REQUEST {
      if {[class search myclass equals "[HTTP::host][HTTP::uri]"]} {
        HTTP::redirect [class search -value myclass equals "[HTTP::host][HTTP::uri]"]
      }
    }
    

    Then class myclass should contain text of the form...

    Key              Value
    old.host.com/url http://new.host.com/newurl
    old.host.com/url http://new.host.com/
    old.host.com/url /mynewurl