deni_22991
Jan 04, 2011Nimbostratus
redirect to https multiple uri's while letting others pass through
I am trying to create an iRule that will force ssl on specific multiple URI's under a specific host while letting those that do not need SSL to pass through. I am working on BIG-IP 9.4.7 Build 320.1
I have created a Virtual Server with port 80, created a pool and have added the iRule to the Virtual server. I have a wild card SSL cert that works for our appsf5.com
I have created the following iRule, but it only works once or twice before getting a page not found.
when HTTP_REQUEST
{ if { [HTTP::host] equals "appsf5.com" }{
if { [HTTP::uri] starts_with "/applications/app1" }
{ HTTP::redirect "https://[HTTP::host]/applications/app1/logon.aspx" }
elseif { [HTTP::uri] starts_with "/applications/app2" }
{ HTTP::redirect "https://[HTTP::host]/applications/app2/login.asp" }
elseif { [HTTP::uri] starts_with "/applications/app3" }
{ HTTP::redirect "https://[HTTP::host]/applications/app3/login.asp" }
elseif { [HTTP::uri] starts_with "/applications/app4" }
{ HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
else {HTTP::respond "http://[HTTP::host][HTTP::uri]" }
}
}