Forum Discussion
Hi Samir/all,
From the below mentioned iRules, Option 1 works fine, but when I try with Option 2, it doesn't work(Means, I am able to create and save the iRule, but when I associate with VIP and checking with end users to test it. Its not working as per iRule expectation. I was expecting atleast first "if" condition should work). Anything wrong with Option 2 script? When we get next Change window, I am also planning to check Option 3 irule. Is that Option3 iRule fine?
Option 1:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "https://dctm.corp.abccompany.com/D2"
}
}
Option 2
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "https://dctm.corp.abccompany.com/D2"
}
elseif { [HTTP::uri] starts_with "/BravaServer" } {
HTTP::redirect "http://dctmsecondary.corp.abccompany.com:9080/BravaServer/search/searchtext/52d768ebf0179a2762d444277a17ff015ae19482ad8b24bc7712dd44dbaa627e?request.preventCache=1591756362805 status: 0"
}
else {
drop
}
}
Option 3
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/BravaServer" } {
HTTP::redirect "http://dctmsecondary.corp.abccompany.com:9080/BravaServer/search/searchtext/52d768ebf0179a2762d444277a17ff015ae19482ad8b24bc7712dd44dbaa627e?request.preventCache=1591756362805"
}
}
else {
HTTP::redirect "https://dctm.corp.abccompany.com/D2"
}
}