Forum Discussion
Need 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/siteA (only nee the character c to go C)
I have almost 1000 sites like this and need something that can incorporate all of them HTTP:host will keep changing and the site name is also variable for customer to customer
If this would have been 1 site then I can probably write a hardcoded value but they are more than 1000
Please advise
2 Replies
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
- Ajmal_2608
Nimbostratus
Thanks Patrik
It helps
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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