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...
TNY_122436
Nimbostratus
Dec 24, 2013Seems like there might be a syntax somewhere that is causing error when I compile the iRule. This is the error I get:
Code
01070151:3: Rule [/Common/test_redierct] error:
line 1: [parse error: missing close-brace] [{
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
}
}
}]
line 2: [command is not valid in the current scope] [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*" -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