Forum Discussion
Chris_Olson
Nimbostratus
Nov 10, 2006URI and pool redirection
Having trouble with the following iRule. Any help is appreciated.
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { $uri starts_with "/app1" } {
HTTP::uri [...
Chris_Olson
Nimbostratus
Nov 21, 2006While the below script compiles OK., it does not function as needed. Adding the suffix to the end of the URI only works if you manually type in HTTPS. I'm guessing this has to do with this script itself or another redirect script. Here is the situation:
We have two Vitrual servers with the same address, one https and one http. The HTTP server has the following redirect to https.
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
The HTTPS virtual server has the following applied:
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { $uri starts_with "/prod11" } {
log local0. "\uri was $uri"
HTTP::uri [string map -nocase {"/prod11" "/App/login.cmdx"} $uri]
pool App_EE_11
}
elseif { $uri starts_with "/prod10" } {
log local0. "\uri was $uri"
HTTP::uri [string map -nocase {"/Prod10" "/App/login.cmdx"} $uri]
pool App_EE_10
}
else {
log local0. "\uri was $uri"
HTTP::uri [string map -nocase { * "/App/login.cmdx"} $uri]
Pool App_EE_11
}
}
IF I type https in the URL, the pool is correctly evaluated. If I type in HTTP in the URL it doesn’t appear to evaluate the rule correctly. What am I missing?
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