Forum Discussion
having /%23/path - /#/uri issue matching irule
Our developers have decided to user //uri for the match case, in the f5 it shows up as just / with no //uri. I've tried uri decoding, string map, no luck. Here's my latest attempt to catch the / at the beginning of the uri..
when HTTP_REQUEST {
if { [URI::decode [HTTP::uri]] starts_with "/" } {
switch -exact [string tolower [HTTP::uri]] {
"//a" { HTTP::redirect "http://www.Aredirect.com}
"//b" { HTTP::redirect "http://www.Bredirect.com}
"//c" { HTTP::redirect "http://www.Credirect.com}
}
} }
i think client (browser) does not send URI-fragments to server (bigip).
Fragment identifier
- nitassEmployee
i think client (browser) does not send URI-fragments to server (bigip).
Fragment identifier
- ch4f5_166880NimbostratusI think you're right! The developers couldn't filter/see the / character in Apache either. One of the engineer mentioned that no rewrite parsing engine will be able to filter on this character (f5, apache, IIS, etc).
- nitass_89166Noctilucent
i think client (browser) does not send URI-fragments to server (bigip).
Fragment identifier
- ch4f5_166880NimbostratusI think you're right! The developers couldn't filter/see the / character in Apache either. One of the engineer mentioned that no rewrite parsing engine will be able to filter on this character (f5, apache, IIS, etc).
- ch4f5_166880Nimbostratus
Ok, so does that mean the only option here is for them to recode the URL to use any other character then / to get the irule redirect to work?
- ch4f5_166880Nimbostratus
I tried uri decoding another way, same blank "/" result..
when HTTP_REQUEST { log local0. "irule_blah [HTTP::uri] triggered!"
set tmpUri [string tolower [HTTP::uri]] set uri [URI::decode $tmpUri] log local0. "HTTP uri decoded to $uri triggered!" log local0. "HTTP uri = [HTTP::uri] triggered!" switch -glob $uri { "//a" { HTTP::redirect "http://www.Aredirect.com} "//b" { HTTP::redirect "http://www.Bredirect.com} "//c" { HTTP::redirect "http://www.Credirect.com}
}
info tmm7[23795]: Rule /blah : irule_blah / triggered! info tmm7[23795]: Rule /blah : HTTP uri decoded to / triggered! info tmm7[23795]: Rule /blah : HTTP uri = / triggered!
- Hannes_RappNimbostratus
Many characters have special meaning in TCL. Try using curly braces instead of double quotes.
if { [HTTP::uri] starts_with {/} } { switch [HTTP::uri] { {//a} { HTTP::redirect "http://www.Aredirect.com"} {//b} { HTTP::redirect "http://www.Bredirect.com"} {//c} { HTTP::redirect "http://www.Credirect.com"} } }
- ch4f5_166880Nimbostratus
No luck, but thanks for the suggestion! I logged a case with f5 support as well. This may be a no go. I've done URL decoding before, but never with a sound in the beginning of the path like this. If I change it to any other character, it works fine!
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