C_D_18583
Nov 03, 2005Nimbostratus
String Manipulation
I have the following piece of code in my iRule
elseif { $uri starts_with "/nexus/" } {
pool pool1 }
elseif { $uri starts_with "/earth/" } {
pool pool2}
elseif { [string index [HTTP::uri] end] ne "/" } {
HTTP::redirect "http://[HTTP::host][HTTP::uri]/"
}
else {
pool pool3
}
}
The string extract is added just incase the user forgets to adds a / after the servlet context. The problem I have with this is that when the following request is received
http://testdomain.com/add.html
What happens is a / is appended as http://testdomain.com/add.html/ and then redirected to pool 3 which causes a 404.
1) How do I rewrite the rule so that when http://testdomain.com/add.html is received I can by pass the string/redirect statement?
2) If the servlet context does not match any above, the request should be directed to pool3 ?