Forum Discussion
TNY_122436
Nimbostratus
Dec 23, 2013Redirect iRule with URI redirection and pool distribution
Hi, I have an iRule that redirects URI containing certain syntax. I want to add a switch -glob statement so that the group of URI's that 'starts_with' the /page1, /page2, on so forth gets sent to...
Kevin_Stewart
Employee
Dec 24, 2013There is in fact a missing closing brace.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/read.pdf" } {
HTTP::redirect "https://www.main.com/menu"
} elseif { [HTTP::uri] starts_with "/Mypersonal/formula" } {
HTTP::respond 301 Location "https://www.main.com/colors.html"
} else {
switch -glob [HTTP::uri] {
"/page1*" -
"/page2*" -
"/page3*" -
"/index*" -
"/start*" {
pool orange
}
default {
pool green
}
}
}
}
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