301 redirection issue
301 redirection issue
We are facing issue while trying to get the 302 to 301 redirection on LB.
We are using following i-rule for achiving this.
I-rule for 301 redirection....
when HTTP_REQUEST { if { [HTTP::host] equals "abc.co.in" } { if {!( [HTTP::path] equals "/")} { HTTP::respond 301 Location "https://www.abc.co.in[HTTP::path]" } } }
But instead of this we also have 4 I-rules that are running under the same VIP. Is this cousing issue for not getting redirection to 301 ?
Rule -1 -->
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/" { HTTP::redirect "https://[HTTP::host]/home.aspx" } } }
Rule --> 2
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "abc.co.in" } { HTTP::redirect "[HTTP::host][HTTP::uri]" } }
==========================================
Rule ---> 3
when HTTP_REQUEST { set the URL here, log it on the response set http_request_time [clock clicks -milliseconds] set url [HTTP::host][HTTP::uri] set vip [IP::local_addr]:[TCP::local_port] }
when HTTP_RESPONSE { set client [IP::client_addr]:[TCP::client_port] set node [IP::server_addr]:[TCP::server_port] set nodeResp [HTTP::status] set http_response_time [ clock clicks -milliseconds ] set cn1 [expr $http_response_time - $http_request_time] log connection info log local0.info " MYUNIVERSE PORTAL : TOTAL-TIME (msec): $cn1 REQUEST-TIME(msec): $http_request_time RESPONSE-TIME(msec) : $http_response_time ---> Client: $client ---> VIP: $vip ---> Node: $node" }
===========================================
Request you to please help me to get this resolve...