Forum Discussion

Ajit's avatar
Ajit
Icon for Altostratus rankAltostratus
Apr 07, 2014

irule to change the host header of a URL

Hi All,

 

I am a beginner in irules and hence need your help with this one.

 

I want to create an iRule for a VIP / VS that will redirect any url with "beta" as the host to the same url path but with "www" as the host.

 

Thanks in advance !

 

1 Reply

  • for a redirect, that would be doable with something like this (assuming beta.domain.com):

    when HTTP_REQUEST {
      if { [HTTP::host] starts_with "beta" } {
        HTTP::redirect "http://www.[domain [HTTP::host] 2]"
      }
    }