cwdusheke
Jan 23, 2020Nimbostratus
Solved
irule - converting if to switch
I am trying to convert my irule from using the if to the switch. Here' s an email of my old irule. when HTTP_REQUEST { if { (([HTTP::host] contains "abc1.com") && ([HTTP::uri] == "/" )) }{ ...
- Jan 23, 2020
Hello.
Try this:
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "*abc1.com" { if { [HTTP::uri] eq "/" } { HTTP::uri "/tf/myPLAN/SponsorWelcome?cz=123456789" } } "*abc2.com" { if { [HTTP::uri] eq "/" } { HTTP::uri "/tf/myPLAN/SponsorWelcome?cz=223456789" } } "*example1.com" { HTTP::respond 301 Location "https://example11.com" } "*example2.com" { HTTP::respond 301 Location "https://example22.com" } } }
KR,
Dario.