Forum Discussion
Michael_Yates
Jul 06, 2010Nimbostratus
You could do it this way:
when HTTP_REQUEST {
if { [HTTP::host] equals "www.domain.com" } {
if { [string tolower [HTTP::uri]] starts_with "/directory" } {
pool pool.of.servers.to.service.request
}
else {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
If the Virtual Server is only used to service things for "www.domain.com" then you could clean it up even more:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/directory" } {
pool pool.of.servers.to.service.request
}
else {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}