Forum Discussion
Moe_Jartin
Cirrus
Jan 05, 2009Context Root Masking/URL Rewrite and pool selection
I have an existing iRule that simply selects poolA based on a list of URIs, everything else goes to poolB.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
...
Moe_Jartin
Cirrus
Jan 05, 2009Aaron,
Thanks for the response. So this is what I have, tying in the original rule:
when HTTP_REQUEST {
Prepend /contextroot to masked URIs and send to poolA
if {[matchclass [[string tolower [HTTP::uri]] starts_with $::maskedURIs]} {
HTTP::path "/contextroot[HTTP::path]"
pool poolA
Send other URIs thru original "switch -glob"
} else {[switch -glob [string tolower [HTTP::uri]]} {
/contextroot* -
/front* -
/static* -
/css* -
/flash* -
/images* -
/jsimages* -
/xml* -
/xsl* -
/vgn-ext-templating* -
/ -
/script/\* -
/interpret* -
/disabilit* -
/shared* {
pool pool_A
}
default {
pool pool_B
}
}
when HTTP_RESPONSE {
Remove /contextroot from HTTP responses
if {[[HTTP::header value "Content-Type"] contains text]} {
STREAM::expression "@/contextroot@@"
STREAM::enable
} else {
STREAM::disable
}
}
I removed the 200 response requirement. I had origianlly added it so as not to overwrite 301 or 302 redirects that might happen to have that in it but I guess I should be overwriting those anyway.
I will run this on my test box and see if it works. Thanks Again!!!
Joe
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
