Forum Discussion
f5now_28704
Nimbostratus
Oct 22, 2007combining two redirect irules
He guys, I have two irules that I didnt know if I could make them in to one both are redirection.
1.
when HTTP_REQUEST {
if { [HTTP::uri] eq "/application.aspx" } {
HTTP::redirect "https://www.google.net/application.aspx"
}
}
2.
when HTTP_REQUEST {
if { [HTTP::host] equals "google.net" } {
HTTP::redirect "http://www.google.net[HTTP::uri]"
}
}
I tryied this...looks to work
when HTTP_REQUEST {
if { [HTTP::uri] eq "/application.aspx" } {
HTTP::redirect "https://www.google.net/application.aspx"}
else {
if { [HTTP::host] equals "google.net" } {
HTTP::redirect "http://www.google.net[HTTP::uri]"
}
}
}
is there a cleaner way for this or is this fine.
1 Reply
- hoolio
Cirrostratus
That looks fine. When including multiple redirects in a rule, or multiple rules for the same VIP, you just have to make sure that two redirects can't be issued for one HTTP request.when HTTP_REQUEST { if { [HTTP::uri] eq "/application.aspx" } { HTTP::redirect "https://www.google.net/application.aspx" } elseif { [HTTP::host] equals "google.net" } { HTTP::redirect "http://www.google.net[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