Forum Discussion
Andrew_Hinkley_
Nimbostratus
May 16, 2007iRule and default pool
I have this irule applied to a virtual server with a default pool of "MYPOOL", to take an HTTP request and redirect to HTTPS while maintaining the query string. Is the below "else" statement necessary, or will the irule use the default pool if the conditional statement is not matched? In testing it seems to work with the else statement, but I want to verify the functionality.
rule HTTP_to_HTTPS.login.irule {
when HTTP_REQUEST {
redirect /root/login.asp to https
if { [HTTP::uri] matches_regex "/root/login.asp"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
} else {
pool MYPOOL
}
}
}
If I just use the below irule is this functionally equivalent?
rule HTTP_to_HTTPS.login.irule {
when HTTP_REQUEST {
redirect /root/login.asp to https
if { [HTTP::uri] matches_regex "/root/login.asp"} {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
}
-andrew
- Colin_Walker_12Historic F5 AccountYes, the second example should be functionally the same if you have the default pool set on the Virtual.
when HTTP_REQUEST { redirect /root/login.asp to https if { [HTTP::uri] equals "/root/login.asp"} { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects