Forum Discussion
Lee_Sutcliffe
Jul 05, 2018Nacreous
There are a few ways you can achieve this, I've supplied a couple. Assuming when you say, 'route them to' you have your pools set up and you need to replace the host header and use the appropriate URI?
This could be one option, put your two FQDNs in a list with the one you want to ultimately use in the first entry.
when HTTP_REQUEST {
set fqdnList {www.host1.com www.host2.com}
if {[lsearch $fqdnList [HTTP::host]] != -1} {
if {([HTTP::uri] equals "/access") || ([HTTP::uri] equals "/")} {
HTTP::host [lindex $fqdnList 0]
HTTP::uri "/content"
}
}
}
This alternative method maybe easier to understand:
when HTTP_REQUEST {
if {([HTTP::host] equals "www.host1.com") || ([HTTP::host] equals "www.host2.com") } {
if {([HTTP::uri] equals "/access") || ([HTTP::uri] equals "/")} {
HTTP::host www.host1.com
HTTP::uri "/content"
}
}
}