Lazaro_Pereira_
Aug 11, 2014Nimbostratus
Solved
iRule to change a take a URL and add URI then send to a Pool.
Hi Everyone,
I have a simple pool selection iRule in place for some internal sites but have been asked to have a URI added at the end to make it easier for people to access. I currently have:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"sharepoint.test-site.com" {
pool /Internal/F5-Internal-Pool_sharepoint
}
default {
discard
}
}
}
and I would like merge it with something along the lines of :
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/" } {
HTTP::redirect "https://[HTTP::host]/Pages/default.aspx"
}
}
How would I merge these two together?
Try this one:
when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "sharepoint.test-site.com" { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/Pages/default.aspx" } else { pool /Internal/F5-Internal-Pool_sharepoint } } default { discard } } }