This article describes how to redirect an HTTP request to an HTTPS server and retain the path and query of the URL.
A user might attempt to access a secure web site by sending an HTTP request. Instead of dropping the request, you might want to redirect the request to the secure Web site. You can use the Responder feature of the NetScaler appliance to redirect a HTTP request to the secure Web site without changing the path and query of the URL that the user attempts to access.
Complete the following procedure to redirect an HTTP request to an HTTPS server and retain the path and query in the URL:
Create a responder action to hostname, path, and query of the URL:
add responder action rdr_new redirect "\"https://\"+http.REQ.HEADER(\"Host\").HTTP_HEADER_SAFE+http.REQ.URL.PATH_AND_QUERY.HTTP_URL_SAFE"
Run the following command to create responder action to check the hostname of the URL:
add responder policy redr_pol "http.REQ.HOSTNAME.EQ(\"example.com\") && client.TCP.DSTPORT.EQ(80)" rdr_new
Run the following command to set the undefined action parameter for the responder feature:
set responder param -undefAction NOOP
Bind the policy at an appropriate bind point, such as globally or a virtual server.
The preceding configuration enables you to redirect users who are trying to access http://domain1.com/test/site to https://domain1.com/test/site.
Note: This example is given only for reference purpose.