Forum Discussion
iaine
Jan 14, 2016Nacreous
It also looks like you are missing an open { at the end of you opening if statement and the a corresponding close. Also, you've missed a : from a HTTP::uri. The code below should now hopefully save.
when HTTP_REQUEST {
set requestedHost [HTTP::host]
if { ([HTTP::uri] starts_with "/URI1") || ([HTTP::uri] starts_with "/URI2") || ([HTTP::uri] starts_with "/URI3") || ([HTTP::uri] starts_with "/URI4") || ([HTTP::uri] starts_with "/URI5") || ([HTTP::uri] starts_with "/URI6")} {
Static content is available on paths beginning /web and should be routed to a specific pool
if { [HTTP::uri] starts_with "/web" } {
if { [active_members hda_twss_web_pool] < 1 } {
log local0. "No pool member a available in hda_twss_web_pool"
HTTP::redirect "http://www.wheatly-group.com"
return
} else {
pool hda_twss_web_pool
log local0. "Sending to pool hda_twss_web_pool"
return
}
} elseif { not( [HTTP::uri] starts_with "/path/" ) } {
Application Content
Rewrite the uri based on a host match
switch [HTTP::host] {
"t-my.site.org" {
HTTP::uri "/path/to/features/AAtheme[HTTP::uri]"
}
"t-my.site2.org" {
HTTP::uri "/path/to/features/BBtheme[HTTP::uri]"
}
"t-my.site3.org" {
HTTP::uri "/path/to/features/CCtheme[HTTP::uri]"
}
"t-my.site4.org" {
HTTP::uri "/path/to/features/DDtheme[HTTP::uri]"
}
"t-my.site5.org" {
HTTP::uri "/path/to/features/EEtheme[HTTP::uri]"
}
"t-my.site6.org" {
HTTP::uri "/path/to/features/FFtheme[HTTP::uri]"
}
}
pool hda_twss_web_pool
log local0. "URI rewrite to HTTP::uri"
}
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] } {
HTTP::cookie domain JSESSIONID "$requestedHost"
HTTP::cookie path JSESSIONID "/"
}
}