Forum Discussion
Rewrite to URL and strip part of the URI
The string map command replaces content within the given file, in this case the HTP::uri.
So using the supplied syntax:
{"/V1" "" "/V2" ""}
persona-api.domainname.com/v2/xyz/ becomes Persona-api.domainname.com/xyz/
To amplify Michael's comments to my original post, you can either set this in an HTTP::uri statement, which conceals the true path from the user, or simply redirect them to the new path:
if { ( [string tolower [HTTP::uri]] contains "/v1 ) or ( [string tolower [HTTP::uri]] contains "/v2" ) } {
set uri [string map -nocase {"/V1" "" "/V2" ""}]
HTTP::redirect "http://[HTTP::host]$uri"
}
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