Forum Discussion
Shivesh_Rege
Nimbostratus
Jun 02, 2009irule causing loop.
Hi Friends,
I am facing an issue with an irule going into loop.Could someone help me resolving it.
when LB_FAILED {
if{[active_members [LB::server]]<1}
HTTP::redirect "http://[HTTP::host]/error/404.html"}
when HTTP_REQUEST {
if {([HTTP::path] ends_with "/doc")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/minisite")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/fslink")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/ms")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/link")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/null-request")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/exttracking.dyn")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {([HTTP::path] ends_with "/ms_1020109.html")} {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
elseif {[string tolower [HTTP::host]] contains "join" } {
HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/join.jsp"}
elseif {[string tolower [HTTP::host]] contains "MysteryBookOffer" } {
HTTP::redirect "http://[HTTP::host]/ecom/nm/link/home?YSID=1129&YTYP=net&YTID=BN4_02_k8_E66"}
elseif {[string tolower [HTTP::host]] contains "historybookclub" } {
HTTP::redirect "http://[HTTP::host]ecom/nm/link/home?YSID=1128&YTYP=net&YTID=BN3_02_h7_E65"}
elseif {[string tolower [HTTP::host]] starts_with "www" or "www1"} {
HTTP::c"http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}}
Thanks & Regards,
Shivesh
- The sections where you are checking for the host names and then redirecting to the same hostname will almost certainly cause a recursive loop.
elseif {[string tolower [HTTP::host]] contains "join" } { HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/join.jsp"} elseif {[string tolower [HTTP::host]] contains "MysteryBookOffer" } { HTTP::redirect "http://[HTTP::host]/ecom/nm/link/home?YSID=1129&YTYP=net&YTID=BN4_02_k8_E66"} elseif {[string tolower [HTTP::host]] contains "historybookclub" } { HTTP::redirect "http://[HTTP::host]ecom/nm/link/home?YSID=1128&YTYP=net&YTID=BN3_02_h7_E65"} elseif {[string tolower [HTTP::host]] starts_with "www" or "www1"} { HTTP::c"http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp"}
- Shivesh_Rege
Nimbostratus
Thanks Joe - JRahm
Admin
[LB::server] returns a list. You most likely want [LB::server pool]. - Shivesh_Rege
Nimbostratus
Hi Jason, - Colin_Walker_12Historic F5 AccountWhen you say it's not working, do you mean it's returning nothing, or that it's not returning what you want?
- Shivesh_Rege
Nimbostratus
Hi Colin , - Colin_Walker_12Historic F5 AccountTry getting rid of the redirect and just re-writing the URI instead.
- Shivesh_Rege
Nimbostratus
Hi Friends, - L4L7_53191
Nimbostratus
You wouldn't have a fallback host configured on this virtual server's HTTP profile, would you? If so, that could be complicating matters. - Shivesh_Rege
Nimbostratus
Hi Matt,
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