Forum Discussion
ras2018_335513
Nimbostratus
Dec 17, 2018URI Redirect Coveo Index Test
Looking for assistance with a uri redirect where certain elements of the URI are subject to change,
but the remaining items stay the same.
As an example:
https://api-itg-1.testdomain.com/ab...
Faruk_AYDIN
Altostratus
Dec 17, 2018Hi Guy,
Use this irule:when HTTP_REQUEST {
if {[HTTP::host] eq "api-itg-1.testdomain.com" and [HTTP::path] starts_with "/abc-" } {
set firstPartOfURI [getfield [HTTP::uri] "/" 2]
set lastPartOfURI [findstr [string range [HTTP::uri] 2 end] / 1]
set firstPath [getfield firstPartOfURI "-" 2]
set secondPath [getfield firstPartOfURI "-" 3]
HTTP::redirect "/${firstPath}/${secondPath}/${lastPartOfURI}"
}
}
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
