Forum Discussion
Feb 25, 2015
BIG-IP : irule wildcard for redirect location
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
Are iRule wildcards smart enough to transfer across from a match-path to a redirect location ?
Does this work ?
switch -glob [strin...
JG
Cumulonimbus
Feb 26, 2015You could do something like the following:
switch -glob [string tolower [HTTP::host]] {
"www.mysite.com" {
switch -glob [string tolower [HTTP::uri]] {
"/old-path*" {
set new_uri [string map {"/old-path" "/new-path" } [HTTP::uri]]
HTTP::respond 301 Location "$new_uri"
}
}
}
}
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