Forum Discussion
jmartinez_44554
Nimbostratus
Aug 21, 2015Need to replace middle of URL
I need to replace the middle of this url and some others.
http://test.host.com/Library/content/en/Integrators-v1/GUID-7CDA266F-3924-4B28-A026-3092CDB17E7B
Needs to be
http://test.host...
Kevin_Stewart
Employee
Aug 21, 2015You're missing the wildcard on the end of your URI evaluation:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/library/content/en/integrators-v1/*" {
set newURI [string map -nocase {"/Library/content/en/Integrators-v1/" "/Library/content/en/product-v2/"} [HTTP::uri]]
log local0. "redirecting to http://[HTTP::host]$newURI"
HTTP::redirect "http://[HTTP::host]$newURI"
}
}
}
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