Forum Discussion
SSell
Altostratus
Sep 18, 2015iRule to redirect to new url, but retain path after first location
I have been tasked with creating an irule to redirect a url to a new server. However the existing server will still have other urls still working on it. We need to retain everything in the URL afte...
PSritaC
Altostratus
Feb 19, 2020Hello
I have a similar issue - where the redirection should retain path after the second location.
when HTTP_REQUEST {
# Do redirects.
if { ([string tolower [HTTP::host]] equals "abcshare") and ([HTTP::uri] starts_with "/site/app") } {
HTTP::respond 301 Location "https://app.abcshare.com[HTTP::uri]"
}
elseif { [string tolower [HTTP::host]] equals "abcshare" and ([HTTP::uri] starts_with "/") } {
HTTP::respond 301 Location "https://abcshare.com/"
}
}
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