Forum Discussion
FYI, I got the following to work via traffic policy; however it's not using the datagroup which is what I want to have a way to easily add new host to URI mappings without having to add another Rule in the case of traffic policies or iRules. So as Niels van Sluis suggested it seems to be an issue with [HTTP::uri] equals '/'. As soon as I added this to the traffic policy my redirect loop stopped.
Static Traffic Policy
ltm policy CC-Host-to-URI-Redirect-Policy {
controls { forwarding }
description "Redirect URIs based on Host"
last-modified 2019-05-28:15:10:00
requires { http }
rules {
CC-Site-Host-to-URI-Redirect-Rule {
actions {
0 {
http-reply
redirect
location https://cc.site.com/cc/
}
}
conditions {
0 {
http-host
host
values { cc.site.com }
}
1 {
http-uri
path
values { / }
}
}
ordinal 1
}
CC-Site1-Host-to-URI-Redirect-Rule {
actions {
0 {
http-reply
redirect
location https://cc.site1.com/cc1/
}
}
conditions {
0 {
http-host
host
values { cc.site1.com }
}
1 {
http-uri
path
values { / }
}
}
}
}
status published
strategy first-match
}