Forum Discussion

VFB's avatar
VFB
Icon for Cirrus rankCirrus
Apr 20, 2021

Redirect rewrite iRule

I'm trying to craft an irule to do the following: If user hits site-1 and has /europe/[HTTP::uri], redirect him to site-2, remove /europe and add /america, and append trailing URI of the initial request.

 

when HTTP_REQUEST {

if {[HTTP::host] == www.site-1.com && [HTTP::uri] == "/europe/[HTTP::uri]" } {

HTTP::redirect "www.site-2.com/america/[HTTP::uri] }

}