Redirection based non URI using iRule for an HTTPS Virtual Server
we have virtual server configured on 443 and offloading SSL as well. Please help me with the iRule to redirect URL based on URI key words.
For example, if the URL is https://abc.com, it should redirect to https://abc.com/client/servcie/
Tried the below iRules and none of them are working:
iRule1:
when HTTP_REQUEST { if {[HTTP::host] equals “abc.com” } { HTTP::redirect "https://abc.com/client/servcie/"; } }
iRule2:*
when HTTP_REQUEST { if {[HTTP::uri] contains"abc"} { HTTP::redirect "https://abc.com/client/servcie/";} }
iRule3:*
when HTTP_REQUEST { if { [HTTP::uri] equals "abc.com"}{ log local0. "PATH MATCH / URI: [HTTP::uri] HOST: [HTTP::host]" HTTP::redirect "https://abc.com/client/servcie/"; } }
iRule4-But its looping:
when HTTP_REQUEST { if { [HTTP::host] equals "abc.com" } { HTTP::respond 301 "Location" "https://abc.com/client/servcie/[HTTP::uri]" } }