iRules not working

Hi,

I have set-up one F5 node in lab environment. Everything is working fine except iRules. Some of the iRules are not working, syntax is correct. I tried everything but it is not working. Need ur help. Simple redirect using if statement is not happening. e.g. below one.

F5’s is running on 14.1.

if {[HTTP::host] equals “abc.com” }

{HTTP:: redirect “par.com”}

Need your help.

Hello BK,

This is may be happening because there’re some changes in iRules syntax/behavior for respond and redirect in 14.1 and 15.x version.

Below article will help you.

Hope it helps!

Mayur

v14 and v15 use policy

if you want irule, try this one

when HTTP_REQUEST {

switch [HTTP::host] {

“abc.com” {

HTTP::respond 301 Location “https://par.com[HTTP::uri]”

}

}

}

:ok_hand:

Oh I see! Thanks for letting me know. I was not aware of this change in behaviour. I will try changes suggested in the article. But​ it’s seems to be only workaround but not fix. :frowning:

Thanks Sajid, I will try this one also.​

As of now, this is the only solution.

Mayur​

with the workaround given in the article, iRules are working now. I tried multiple iRules. Thank you.​

Hi Sajid, changes suggested in article shared by Mayur solved my issue.​ Thank you.

Finally I was able to run all my iRules on my F5 14.1.

Thank you guys.​