Forum Discussion
igor_
Cirrus
Jul 21, 2023LTM Policy HTTP Rewrite Rule
Hi all, I am trying to rewrite the part of Path URI using LTM Policy but the problem is when the Path URI gets rewritten the whole URI is rewritten without keeping the rest of the path. So for exam...
Paulius
MVP
Jul 21, 2023igor_ Sadly I'm far familiar with iRules than traffic policies so I'm not sure if you can do this in a traffic policy. What you want to do is a string map rather than a rewrite and the string you want to map is "/path1/v2/d" to "/path/app" which should conver the path as it traverses the F5 VS and is sent to the pool members.
JRahm
Admin
Jul 24, 2023So igor_ , what Paulius is saying here is to use the local traffic policy, but you can use Tcl in it to avoid the separate iRule:
rewrite_uri_path_partial {
actions {
0 {
http-uri
replace
value "tcl:[string map {/path1/v2/d/ /path/app/} [HTTP::uri]]"
}
}
conditions {
0 {
http-uri
path
starts-with
values { /path1/v2/d/ }
}
}
ordinal 1
}
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