Forum Discussion
Mojdeh_Koushki_
Nimbostratus
Oct 14, 2005iRule Script in Ver 9 is not functioning
hello
here is my problem, i have a set of bigip for bunch of web farm on ver 4.5.10, which i have this iRule for it and it is functioning Very Well...
if (getfield(http_uri, '/', 2) matches_regex "[Ww][Ee][Bb][Aa][Pp][Pp]") {
redirect to "https://%h/%u"
}
else {
use pool WebApp-50
}
and now we are upgrading to version 9 and compatable iRule for version 9 is COMPILING but NOT FUNCTIONING ...
here is the script...
when HTTP_REQUEST {
if { [string tolower [getfield [HTTP::uri] '/' 2]] == "webapp" } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
} else {
pool POOL_HTTP_Vlan70
}
}
could you please tell me WHY?
thanks alot
Mojdeh
- Mojdeh,
when HTTP_REQUEST { if { [string tolower [getfield [HTTP::uri] "/" 2]] == "webapp" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } else { pool POOL_HTTP_Vlan70 } }
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/webapp" } { HTTP::redirect "https://[HTTP::host][HTTP::uri] } else { pool POOL_HTTP_Vlan70 } }
when HTTP_REQUEST { set uri [HTTP::uri] set field [getfield $uri '/' 2] set lower [string tolower $field] set slash '/' set field2 [getfield $uri "/" 2] set lower2 [string tolower $field] set slash2 "/" log local0. "URI: $uri" log local0. "Field: $field" log local0. "Lower: $lower" log local0. "slash: $slash" log local0. "Field2: $field2" log local0. "Lower2: $lower2" log local0. "slash2: $slash2" }
- Mojdeh_Koushki_
Nimbostratus
well, Joe, when i am changing it to Double quote , then it ois not even can hit the page .... - Colin_Walker_12Historic F5 Accountkoushki,
- Mojdeh_Koushki_
Nimbostratus
Coline, - Mojdeh_Koushki_
Nimbostratus
equvelent in ver 9 which i am running now is this : - Mojdeh_Koushki_
Nimbostratus
Colin, - Did you try adding the logging statements I suggested. I verified my rule works with a uri of http://hostname/WebApp (or any upper-lower case version of WebApp).
when HTTP_REQUEST { set uri [HTTP::uri] set field [getfield $uri '/' 2] set lower [string tolower $field] set slash '/' set field2 [getfield $uri "/" 2] set lower2 [string tolower $field] set slash2 "/" log local0. "URI: $uri" log local0. "Field: $field" log local0. "Lower: $lower" log local0. "slash: $slash" log local0. "Field2: $field2" log local0. "Lower2: $lower2" log local0. "slash2: $slash2" if { [string tolower [getfield [HTTP::uri] "/" 2]] equals "webapp" } { log local0. "Found match for webapp!" HTTP::redirect "https://[HTTP::host][HTTP::uri]" } else { log local0. "Didn't find match for webapp!" pool POOL_HTTP_Vlan70 } }
- Mojdeh_Koushki_
Nimbostratus
Joe - Mojdeh_Koushki_
Nimbostratus
Joe - Please post the log output here. I tested things with using single quotes and the getfield command didn't return any string. I'd be interested in seeing if that's not the same for you. Only the log output will tell...
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