Brent_Sachnoff_
May 24, 2006Nimbostratus
funny things happen with basic iRule
Hi. I have this iRule that appeared to work the first couple of times around and now only works for the 1,2 and last case within the if clause. I'm sure there is a better way to write it but I'm still learning:
when HTTP_REQUEST {
if { [HTTP::host] starts_with "a.company.com" }
{ HTTP::redirect "https://www.company.com/123/Login.html" }
elseif { [HTTP::host] starts_with "company.com" }
{ HTTP::redirect "https://www.company.com/123/Login.html" }
elseif { [HTTP::uri] equals "/" }
{ HTTP::redirect "https://[HTTP::host]/123/Login.html" }
elseif { [HTTP::uri] equals "/Login.html" }
{ HTTP::redirect "https://[HTTP::host]/123/Login.html" }
elseif { [HTTP::uri] equals "/456/index.html" }
{ HTTP::redirect "https://[HTTP::host]/123/Login.html" }
elseif { [HTTP::uri] equals "/mobileLogin.html" }
{ HTTP::redirect "https://[HTTP::host]/123/Login.html" }
else { HTTP::redirect https://[HTTP::host][HTTP::uri] }
}
Any reason for this not to work for all the clauses above?
Thanks!