Forum Discussion
Lee_Sutcliffe
Nov 21, 2018Nacreous
Hi Aditya,
If using a traffic policy as Philip has suggested, is not an option, you could use the following iRule:
when HTTP_REQUEST {
set var1 "xxx"
set var2 "/"
set newHost "b.a.c.com"
if {([HTTP::uri] contains $var1) && ([HTTP::uri] contains $var2)} {
set newUri [string map -nocase [list $var2 ""] [HTTP::uri]]
HTTP::redirect https://${newHost}${newUri}
} elseif {!([HTTP::uri] contains "/")} {
HTTP::redirect https://$newHost[HTTP::uri]
}
}