Forum Discussion
farache_28983
Sep 05, 2012Nimbostratus
Rewrite to URL and strip part of the URI
Hi guys,
Basically i need to do this.. been testing different scenarios with HTTP_request and HTTP_RESPONSE but no luck.
When a url comes through from this domain, we would like to ...
Michael_Yates
Sep 10, 2012Nimbostratus
Sorry...That won't work 🙂
You could use the above to set the Variable like this: set uri [HTTP::uri [string map {"/v1" "" "/v2" ""} [HTTP::uri]]] Then you could do the following: HTTP::redirect "http://[HTTP::host]$uri" Or you could l just do this: when HTTP_REQUEST { if { ( [string tolower [HTTP::uri]] contains "/v1" ) or ( [string tolower [HTTP::uri]] contains "/v2" ) } { HTTP::redirect "http://[HTTP::host][string map {"/v1" "" "/v2" ""} [HTTP::uri]]" } }
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