Forum Discussion
ekaleido_26616
Cirrocumulus
I am assumig you don't want to actually redirect them to the URL/URI they originally requested, so rather than redirect, I made the action to simply send the traffic to the relevant pool name. In this example, a pool named "whatever." Using switch will allow you to expand the concept should you require other redirects later.
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if { $host = "www.placeone.com" || "placeone.com" } {
switch [HTTP::uri] {
"/" { HTTP::respond 301 Location "https://www.placetwo.com/subplace/" }
default { pool whatever }
}
}
Vijay_E
Jul 14, 2016Cirrus
The above iRule should work in terms of sending a redirect to the client and the client will initiate the connection again to the new location.