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
11 Replies
- Here's a rewritten version of the iRule that might be more easier to manage:
when LB_FAILED { if{[active_members [LB::server pool ]] < 1 } { HTTP::redirect "http://www.google.com" } } when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "*/doc" - "*/minisite" - "*/fslink" - "*/ms" - "*/link" - "*/null-request" - "*/exttracking.dyn" - "*/ms_1020109.html" { HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp" } "/" { switch [string tolower [HTTP::host]] { "www.abcd.com" - "www1.abcd.com" { HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/nmhomepage.jsp" } "www.joinabcd.com" - "www1.join.abcd.com" { HTTP::redirect "http://[HTTP::host]/ecom/pages/nm/join.jsp" } } } } }
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
