Forum Discussion
Hien_Truong
Sep 03, 2020Cirrus
Redirect all under the part of uri
Hi, i have trouble to redirect " * " under part of uri. The below is one redirect: https://www.abc.com/defe/* redirect to https://sample.com/redirect-to-legacy/new-defe/* Below is my...
Sep 03, 2020
Hi Hien Truong,
Can you try this?
when HTTP_REQUEST {
if { [HTTP::host] equals "www.abc.com" && [HTTP::path] starts_with "/defe/" } {
set newpath [string map {"/defe/" "/redirect-to-legacy/new-defe/"} [HTTP::path]]
HTTP::respond 301 Location "https://sample.com$newpath"
}
}
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