Forum Discussion
mikand_61525
Feb 17, 2012Nimbostratus
Replace (and remove) characters from URIs?
Im trying to setup an irule that will convert "\" into "/" and also remove redundant "/" (turning "//" into "/") for HTTP::uri.
What is the recommended way (performance wise) to do these two...
nitass
Feb 17, 2012Employee
data group.
e.g.
[root@ve1023:Active] config b class convert_list list
class convert_list {
{
"//" { "/" }
"\\\\" { "/" }
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set uri [HTTP::uri]
foreach item [class get convert_list] {
set uri [string map $item $uri]
}
log local0. "[HTTP::uri] -> $uri"
}
}
[root@ve1023:Active] config cat /var/log/ltm
Feb 17 03:55:35 local/tmm info tmm[4822]: Rule myrule : /test1\/test2/test3//test4 -> /test1/test2/test3/test4
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