Forum Discussion

Wasim_Hassan_13's avatar
Wasim_Hassan_13
Icon for Nimbostratus rankNimbostratus
Oct 10, 2013

F5 iRule

Hi,

 

I have configured my F5 in single arm mode. I have following requirement when user hit the VIP http://192.168.205.151 or http://mycompany it should redirect to full URL Path http://mycompany/arsys.

 

when HTTP_REQUEST { if {[HTTP::host] equals "http://192.168.205.151/" } { HTTP::redirect "http://mycompany/arsys"

 

Please assist me.

 

3 Replies

  • Try this:

    when HTTP_REQUEST {
     if { [HTTP::host] equals "192.168.205.151" } {
      HTTP::redirect "http://mycompany/arsys"
     }
    }
    
  • Assuming that either IP or name will get you to the VIP, you can probably not worry about evaluating that and just redirect based on the URI value. Example:

    when HTTP_REQUEST {        
        if { [HTTP::uri] equals "/" } {        
            HTTP::redirect "http://mycompany/arsys"
        }
    }