Forum Discussion
spalande
Nacreous
Jun 07, 2019Rewrite first uri string
Requirement is to rewrite only first uri string.
Eg. https://www.company.com/test/example/test/index.htm to https://www.company.com/testUI/example/test/index.htm
With string map syntax, all "test" in URI part are getting rewrite. also tried split uri to get the first string, set variable and then use string map, but no luck. Can someone please help with any pointer?
Thanks
- Lee_Sutcliffe
Nacreous
try this
when HTTP_REQUEST { HTTP::uri /[join [lreplace [split [string trimleft [HTTP::uri] /] /] 0 0 "testUI"] /] }
- spalande
Nacreous
@Lee - Thanks. This is indeed working as expected.
- Stanislas_Piro2
Cumulonimbus
you can also try this:
when HTTP_REQUEST { if {[scan [HTTP::path] "/test/%s" var]} { HTTP::path /testUI/$var } }
- Lee_Sutcliffe
Nacreous
Nice solution Stan, didn’t think of doing it that way
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