Forum Discussion
Ajmal_2608
Nimbostratus
Mar 14, 2014Need a specific character to be changed in the URI
Hi
I am looking for an iRule/regex/string handling mechanism which can help me with this:
incoming - www.website.com/global/customers/siteA
convert to - www.website.com/global/Customers/sit...
Mar 14, 2014
Try this one (remove the logging before applying it in production):
when HTTP_REQUEST {
set uri [HTTP::uri]
log local0. "Uri before replacing: $uri"
if { $uri starts_with "/global/customers/" } {
Replacing uri
set uri [string map {"/global/customers/" "/global/Customers/"} $uri]]
log local0. "Uri after replacing: $uri"
HTTP::uri $uri
}
}
Good luck!
/Patrik
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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