Jonathan_Scholi
Oct 28, 2010Cirrostratus
String map and redirect
I need to perform a redirect that changes a URI from this format:
mysite.com/it/folder/files/FILESANDFILES
to:
mysite.com/it/folder/files/filesANDfiles
In other words, part of the URI needs to be converted to lowercase, while leaving an intermediate portion intact. Since the portion that needs to be converted to lowercase is very specific, I tried using a string map as follows:
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_with "/it/folder/files" }
{
HTTP::redirect [string map {"folder=FILESANDFILES" "folder=filesANDfiles"} [HTTP::path]]
}
}
This doesn't work, even though it's very similar to other iRules I've used that do work. Any thoughts?