Forum Discussion

Paul_Dawson_103's avatar
Paul_Dawson_103
Icon for Nimbostratus rankNimbostratus
Feb 09, 2006

http redirect

Hello,

 

 

Will this iRule rewrite all requests (both http and https) containing "url1.bdos.bdd.local" in the URI to "http://url2.bdos.bdd.local"?

 

 

Thanks?

 

 

 

--------------------------

 

 

 

 

when HTTP_REQUEST {

 

 

if { [HTTP::uri] contains "url1.bdos.bdd.local" } {

 

 

HTTP::redirect "http://url2.bdos.bdd.local"

 

 

}

 

 

}

 

 

---------------------------------

3 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    That rule will work for both HTTP and HTTPS, provided the BIG-IP is set to terminate the SSL (Client SSL Profile), otherwise it won't be able to inspect the packet information to make the redirect.

     

     

    Note that you will either have to add this rule to both your HTTP and HTTPS VIPs, or have one VIP that handles all ports.

     

     

    -Colin
  • Thanks for that Colin.

     

     

    I'm new to iRules but I have to become familiar - so you may be seeing more of me. :-)

     

     

    Assuming that it wasn't client side SSL and I wanted to redirect, would I then do that on a port basis using the CLIENT_ACCEPTED event descriptor?
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Yes, if you're looking to redirect the connections coming in on port 443, you should be able to do that, but you wouldn't be able to read into any of the HTTP information, as it would be encrypted still.

     

     

    -Colin