Forum Discussion
Aug 26, 2010
This should work. Probably not optimal, but it's the same logic
when HTTP_REQUEST {
if { ([HTTP::host] eq "mydomain.com") && ![HTTP::header exists "WL-Proxy-SSL"] } {
HTTP::redirect "https://mydomain.com[HTTP::uri]"
} elseif { ([HTTP::host] eq "mydomain.com") && ([HTTP::uri] ends_with "/") } {
HTTP::redirect "https://mydomain.com/index.html"
} elseif { ([HTTP::host] eq "www.mydomainone.com") && ([HTTP::uri] ends_with "/") } {
HTTP::redirect "https://www.mydomainone.com/index.html"
} elseif { ([HTTP::host] eq "mydomainone.com") && ([HTTP::uri] ends_with "/") } {
HTTP::redirect "https://mydomainone.com/index.html"
} elseif { ([HTTP::host] eq "mydomainone.com") && ![HTTP::header exists "WL-Proxy-SSL"] } {
HTTP::redirect "https://www.mydomainone.com[HTTP::uri]"
} elseif { ([HTTP::host] eq "www.mydomainone.com") && ![HTTP::header exists "WL-Proxy-SSL"] } {
HTTP::redirect "https://www.mydomainone.com[HTTP::uri]"
} elseif { [HTTP::host] eq "192.160.1.1" } {
discard
} else {
pool MYDOMAIN
}
}
I'm almost positive we can optimize it but I'll have to dig through it to see how the logic flows and make sure all the cases are covered.
Hope this helps...
-Joe