Forum Discussion
Christian_15126
Nimbostratus
Jan 24, 2013irule switch statement not matching header or paths
Marketing has hit me with another irule fun project. This is what they want me to accomplish:
They want 60/40 split load balancing between the following URL's:
-------------- 40% -...
What_Lies_Bene1
Cirrostratus
Jan 25, 2013OK, here's a simple example. If you don't need the * wildcards, you can omit the -glob;
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
If HTTP host contains abc or def, redirect to xyz.com
"*abc*" -
"*def*" { HTTP::redirect https://www.xyz.com/xyz }
If HTTP host contains ghi, redirect to mno.com
"*ghi*" { HTTP::redirect https://www.mno.com/mno }
If HTTP host is none of the above, take the default action below
default {
HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
}
Sorry, no time to customise to your rule but hopefully this give you an idea.
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