Unknown behavior on iRule
I have an iRule that reads several statements:
when HTTP_REQUEST {
if { [active_members QA-HEC-HTTP] < 1 } {
switch -glob [string tolower [HTTP::path]] {
"images/*" -
"*.gif" -
"*.jpg" -
"*.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-SEARCH-URI]) and ([HTTP::cookie value "EnterpriseIntegration"] equals "True") } {
pool QA-ENT-HTTP
} elseif { [HTTP::uri] equals "/" } {
pool QA-ENT-HTTP
} elseif { ([class match [string tolower [HTTP::uri]] starts_with QA-HEC-ENT-URI]) and ([HTTP::cookie value "EnterpriseIntegration"] equals "True") } {
pool QA-ENT-HTTP
} elseif { [class match [string tolower [HTTP::uri]] starts_with QA-HEC-URI] } {
pool QA-HEC-HTTP-DNNREDIRECT
} else {
pool QA-HEC-HTTP
}
}
I believe this rule reads traffic and A) Checks that servers are available and if so continues on to the next section and if not sends traffic to the QA-PH pool B) does a read on the URI and checks if a string starts with a entry in QA-HEC-ENT-SEARCH and checks a value of a cookie, if true then sends traffic to QA-ENT-HTTP pool C) checks URI and if true sends to QA-ENT-HTTP pool. D) does a read on the URI and checks if a string starts with a entry in QA-HEC-ENT-SEARCH and checks a value of a cookie, if true then sends traffic to QA-ENT-HTTP pool E) does a read on the URI and checks if a string starts with a entry in QA-HEC-ENT-SEARCH and if true then sends traffic to QA-HEC-HTTP-DNNREDIRECT pool F) All else traffic goes to QA-HEC-POOL.
The problem I'm running into is that somehow the URL is being rewritten. If I go to the homepage and the cookie is true it comes up fine. Next I click on a link that is included in the QA-HEC-ENT-SEARCH-URI group and it should read http://www.healthecareers.qa/search-academics-research-jobs/?specialty=Academics+%2f+Research
but actually comes back as: (basically doubling the query string) http://www.healthecareers.qa/search-academics-research-jobs/?specialty=Academics+%2f+Research&specialty=Academics+%2f+Research
If I host file my machine directly to one of the servers in the QA-ENT-HTTP pool everything works fine and the URL is correct. I don't see any kind of rewrite in my rule. Any thoughts/suggestions?