Forum Discussion
Alex_Tiplitsky_
Nimbostratus
Apr 12, 2005Multiple iRules for a Virtual + HTTP redirect
I currently have an iRool that' redirecting traffic to a certain pool:
when HTTP_REQUEST {
if { [HTTP::uri] contains "psreports" } {
pool CRMWEB_REPORTS
}
elseif { [HTTP::uri] contains "PSOL" } {
pool CRMWEB_PSOL
} else {
pool CRMWEB
}
}
I also need to be able to redirect traffic from:
http://mycrm.xxx.com to http://mycrm.xxx.com/psp/crmprd01/?cmd=login
and the same for https.
when HTTP_REQUEST {
if { [HTTP::uri] equals "mycrm.xxx.com" } {
redirect to "http://mycrm.xxx.com/psp/crmprd01/?cmd=login"
}
}
While the first rule is working perfectly, second one is not...
I am probably making a bunch of errors in the second rule...
PLEASE HELP!
2 Replies
Sort By
- unRuleY_95363Historic F5 AccountI think you might want HTTP::host in the second rule since HTTP::uri returns the URI path and not the host.
- Alex_Tiplitsky_
Nimbostratus
Let me correct myself:when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { redirect to "http://mycrm.xxx.com/psp/crmprd01/?cmd=login" } }
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "http://mycrm.xxx.com/psp/crmprd01/?cmd=login" } elseif { [HTTP::uri] contains "psreports" } { pool CRMWEB_REPORTS } elseif { [HTTP::uri] contains "PSOL" } { pool CRMWEB_PSOL } else { pool CRMWEB } }
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