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) m...
Oct 14, 2005
As you can see from the trace, Field2 which comes from the getfield command with the slash in double quotes is getting set correctly.Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : URI: /webnav/navapp1.asp?association_link=lncust1_hunt&brand_cd=huntxx00
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : Field:
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : Lower:
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : slash: '/'
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : Field2: webnav
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : Lower2:
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : slash2: /
Oct 14 14:23:07 tmm tmm[648]: Rule redirect2 : Didn't find match for webapp!
The the blatant item that sticks out is why you are searching for the string "webapp" when all the uri's being passed in start with "/webnav"?
The Rule is working correctly because the first element past the first slash does not equal "webapp".
Also, I would recommend using my "starts_with" example instead of the getfield. getfield would be good if you had to do something with that string after you extracted it but it's overkill for this situation.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/webnav" } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]
} else {
pool POOL_HTTP_Vlan70
}
}
-Joe
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