Forum Discussion
Kevin_Stewart
Mar 06, 2013Employee
Is it safe to say that you're always redirecting away from "/"? If so, you could use a data group based on the host and the new URI:
ltm data-group internal /Common/host_test_group {
records {
site1.domain.com {
data /aaaa/bbbb/page.aspx\?site=site1
}
site2.domain.com {
data /aaaa/bbbb/page.aspx\?site=site2
}
}
type string
}
when HTTP_REQUEST {
if { ( [HTTP::uri] equals "/" ) and ( [class match [string tolower [HTTP::host]] equals host_test_group] ) } {
found a matching host - redirect
HTTP::respond 301 Location [class match -value [string tolower [HTTP::host]] equals host_test_group]
}
}