Matt_59153
Sep 30, 2008Nimbostratus
iRule relocating top level folders to https. Need some help
Hey all,
Our F5 iRules have been in place for quite some time. We just started digging into them as we are having some issues with folder redirects to secure that it looks like someone found a workaround for by creating iRules for the folders.
i.e. http://www.blah.com/folder01 has a rule to redirect to http://www.blah.come/folder01/default.aspx
If the rule doesn't exist the link goes from the folder01 to https://www.blah.com/folder01/
Here is a sample of the iRules and I am wondering if there is something simple I am missing.
when HTTP_REQUEST {
if { ([HTTP::uri] ends_with "/folder01") and ([HTTP::host] contains "blah.com") } {
HTTP::redirect "http://www.blah.com/folder01/default.aspx"
} elseif { ([HTTP::uri] ends_with "/folder02") and ([HTTP::host] contains "blah.com") } {
HTTP::redirect "http://www.blah.com/folder02/default.aspx"
} elseif { ([HTTP::uri] ends_with "/folder03") and ([HTTP::host] contains "blah.com") } {
HTTP::redirect "http://www.blah.com/folder03/default.aspx"
} elseif { ([HTTP::uri] ends_with "/folder04") and ([HTTP::host] contains "blah.com") } {
HTTP::redirect "http://www.blah.com/folder04/default.aspx"
} elseif { [matchclass [HTTP::host] equals $::BLAH_Hosts] } {
use pool BLAH_WEB
} else {
HTTP::redirect "http://www.blah.com/default.aspx"
}
}
Thanks for the help.