Forum Discussion

Ranvir_Floura_7's avatar
Ranvir_Floura_7
Icon for Nimbostratus rankNimbostratus
Jan 27, 2007

iRule for uri redirection

Hey Gang,

 

 

I would like to get some help in creating a iRule to redirect based on uri.

 

1. Any traffic coming to http://abc.com need to go to https://xyz.com

 

2. Any traffic coming to http://abc.com/%u needs to go to https://xyz.com/%u

 

 

Thanks

1 Reply

  • This should handle 1 and 2.

    when HTTP_REQUEST {
      if { [HTTP::host] equals "abc.com" } {
        HTTP::redirect "https://xyz.com[HTTP::uri]"
      }
    }

    Apply this to your HTTP virtual handling the abc.com domain and you should be set.

    -Joe