Forum Discussion
Eljay
Cirrus
Oct 17, 2023Remove a specific string in path on request and insert on response
Hi guys, I have a challenge for you. I have a policy which will redirect traffic to a different pool/node when the path starts with a specific string. This string must be removed before it is sen...
Paulius
MVP
Oct 17, 2023Eljay I believe what you are looking for is a string map and the following should do exactly what you described in your example.
when HTTP_REQUEST priority 500 {
if {[HTTP::uri] starts_with "/strawberry/"} {
HTTP::uri [string map {"/strawberry/" "/"}[HTTP::uri]]
pool pool_web
}
}
Eljay
Cirrus
Oct 18, 2023Thanks, but I can do this with a policy. It's easier for non-programmers to understand.
- PauliusOct 18, 2023
MVP
Eljay That is absolutely true and in that policy you would use the information from line 4 as a tcl expression in the traffic policy similar to what is shown in the following.
https://somoit.net/f5/f5-bigip-modify-uri-path-using-local-traffic-policy/
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