Forum Discussion
Irule for different URL's to one URL
If the user sends this:
/This/UrL/sAmPle
Then the following evaluation will not match:
if { [HTTP::uri] equals "/this/url/sample" }
If you normalize the input with [string tolower ] however, it will match:
if { [string tolower [HTTP::uri]] equals "/this/url/sample" }
If you don't normalize the input, you must attempt to evaluate the user's input value in the exact same case as entered.
if { [HTTP::uri] equals "/This/UrL/sAmPle" }
Of course if you do that, you'll likely have to expand that evaluation to many different case combinations. The [string tolower ] command does not change the case of the URI value submitted to the backend server, it is simply used to normalize the data for evaluation only. If, however, you absolutely need to evaluate input based on case, then that would be a use case for not using [string tolower ]:
switch [HTTP::uri] {
"/This/UrL/sAmPle" { pool a-pool }
"/THis/UrL/sAmPle" { pool b-pool }
"/THIs/UrL/sAmPle" { pool c-pool }
"/THIS/UrL/sAmPle" { pool d-pool }
"/THIS/URL/sAmPle" { pool e-pool }
"/THIS/URL/SAmPle" { pool f-pool }
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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