Andyhsbos77
Apr 23, 2018Nimbostratus
Creating an iRule with multiple conditions
Hello, New to F5 and iRules here,
I'm looking to create an iRule that looks for certain urls and redirects them. I want to know though if i can combined them into one rule per redirected URL, so for example i created this below but not sure if it is correct. I was hoping to use [HTTP::URI] site1* but there is some directories they do not want to be redirected.
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "site1/virtualdirector1/.aspx" } { HTTP::respond 301 Location "; } } elseif { [string tolower [HTTP::host]] equals "site1/virtualdirectory2/.aspx" } { HTTP::respond 301 Location "; } } elseif { [string tolower [HTTP::host]] equals "site1/virtualdirectory3/*.aspx" } { HTTP::respond 301 Location "; } }