Forum Discussion
URL based redirection using irules is not working
I have problem in my F5 irules the scenario is as follows, appreciate your help in this issue
Http://Dev.abc.com/TEST is my primary URL in this /TEST is the contest root redirected by web server now my requirement is when F5 gets request for a URI "/TEST/Maddy" it has to go to a different pool. I have created rule as follows but it is not redirecting for the "/TEST/Maddy"
when
HTTP_REQUEST {
if
{ ([HTTP::uri] contains "/TEST/maddy")}{
pool web_maddy_pool_port_9001
}
if
{ [string tolower [HTTP::uri]] equals "/" } {
HTTP::redirect "http://dev.abc.com/TEST"
}
else {
pool
Development_TEST_pool_port_7789
}
}
Web_maddy_pool_port_9001 - has IPs of weblogic cluster for Maddy pool
Development_TEST_pool_port_7789
- has IPs of weblogic cluster for default pool
Appreciate your help
- Peter_72728NimbostratusThe last sentence of your explanation says "it is not redirecting for the "/TEST/Maddy"". Is it possible that the problem is just case sensitivity?
- Michael_YatesNimbostratusYou could do something like what I have below.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/" { HTTP::redirect "http://dev.abc.com/test" } "/test/maddy/*" { pool web_maddy_pool_port_9001 } default { pool Development_TEST_pool_port_7789 } } }
- BM_27231Nimbostratus
Thank you
Recent Discussions
Related Content
* 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