Forum Discussion

Marco_Bayarena_'s avatar
Marco_Bayarena_
Icon for Altostratus rankAltostratus
Jul 03, 2012

Rewrite with exceptions

I have a redirect irule that I want to apply expect when it is coming from a specific client IP address(es). I am having issues when some servers try to POST data to VIP with the following iRule applied. I figure it would be easier to just make an exception to the rule.

 

 

when HTTP_REQUEST {

 

if { [TCP::local_port clientside] = 80 } {

 

switch [HTTP::host[ {

 

"www.site1.com" { HTTP::redirect "http://www.site2.com" }

 

"www.site1a.com" { HTTP::redirect "http://www.site2.com" }

 

}

 

}

 

}

 

 

 

 

Any suggestions?

 

1 Reply

  • you do not want to trigger HTTP::redirect if it s POST request, do you? if yes, may we check HTTP::method?

     

     

    HTTP::method wiki

     

    https://devcentral.f5.com/wiki/iRules.http__method.ashx