Forum Discussion
Hiro_Castro_341
Nimbostratus
Nov 23, 2017Remove /api from uri and forward remaining uri
Hi F5 gurus,
I have a real quick question, I am looking for a possible syntax to strip out the /api from all the URIs that hit my VIP and send the remaining URL without changes. Is that possible? I ...
Lee_Sutcliffe
Nacreous
Nov 24, 2017If the user requesting "/api/index/folder" but you want the user to see /index/folder you could use a redirect:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/api"} {
set trim /[getfield [HTTP::uri] "/" 2]
set endUri [string range [HTTP::uri] [string length $trim] end]
HTTP::redirect http://[HTTP::host]$endUri
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
