Forum Discussion
C_D_18583
Nimbostratus
Nov 03, 2005String Manipulation
I have the following piece of code in my iRule
elseif { $uri starts_with "/nexus/" } {
pool pool1 }
elseif { $uri starts_with "/earth/" } {
pool poo...
Nov 03, 2005
You could do a "ends_with" comparison before your check for the slash. if you know the valid extensions that you don't want appended with slashes this should work.
While you are at it you could use the ends_with in place of your string index command as well.
elseif { $uri starts_with "/nexus/" } {
pool pool1
} elseif { $uri starts_with "/earth/" } {
pool pool2
} elseif { [HTTP::uri] ends_with ".html" } {
pool pool3
} elseif { not ([HTTP::uri] ends_with "/") } {
HTTP::redirect "http://[HTTP::host][HTTP::uri]/"
} else {
pool pool3
}
Is this what you are going for? If not, if you could provide a clear set of inputs and expected results, it will be easier for us to figure out a solution.
-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