Forum Discussion
nested elseif unexpected behaviour
I created an iRule to (first) redirect to maintenance page and then if available redirect traffic to 1 of 3 pools based on URI data groups. The iRule compiles fine but the result is unexpected. The correct home page comes up but is missing parts and if I try any of the links the lead nowhere and the home page remains.
New rule:
when HTTP_REQUEST {
if { [active_members INF-HEC-HTTP] < 1 } {
switch -glob [string tolower [HTTP::path]] {
"_.gif" -
"_.css" {
HTTP::uri [string range [HTTP::uri] [string last / [HTTP::uri]] end]
}
default {
HTTP::uri /
}
}
pool QA-PH
} elseif { [class match [string tolower [HTTP::uri]] starts_with QA-HEC-ENT-URI] } {
pool INF-ENT-HTTP
} elseif { [class match [string tolower [HTTP::uri]] starts_with QA-HEC-URI] } {
pool INF-HEC-DNNREDIRECT
} else {
pool INF-HEC-HTTP
}
}
Old rule that works except for maintenace: and no uri
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/ent/*" -
"/"
{ pool QA-ENT-HTTP
return
}
}
switch -glob [string tolower [HTTP::uri]] {
"/site_includes/_" -
"/backoffice_newer_" -
"/emp_banner/_" -
"/media_kits/" -
"/promo/_" -
"/adproducts/" -
"/cst/ui/_" -
"/cst/backoffice/_" -
"/employer_" -
"/employer/" -
"/js-old/_" -
"/employer\asp" -
"/site_templates/_" -
"/assoclist.asp_"
{
pool QA-HEC-HTTP-DNNREDIRECT
}
default
{
pool QA-HEC-HTTP
}
}
}
- ryan_rockwell_1Nimbostratus
As Monty Python says "And Now For Something Completely Different"
So on a whim I copied the image files to the root directory. Didn't change the web page just copied the files. TADA - works like it's supposed to. Completely confused.
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