Summary
This article describes how to configure URL redirection for SSL on a NetScaler appliance.
At times, to ensure a secure access to the Web site, you might want to redirect the client request to a secure link. The URL redirection feature enables you to redirect a client request to a secure Web site on Secure Socket Layer (SSL).
When the HTTP requests hit the first Load Balancing vserver, because it is always down, the requests are redirected to the second Load Balancing vserver with HTTPS request due to the content switching policy.
Procedure
To configure URL redirection for SSL, complete the following procedure:
1. On the NetScaler appliance, run the following command to enable the Content Switching feature:
enable ns feature CS

2. Run the following commands to create two load balancing virtual servers (vserver):
add lb vserver <First_LB_Server_Name> HTTP 0.0.0.0 0 -persistenceType NONE -cltTimeout 180
add lb vserver <Second_LB_Server_Name> HTTP 0.0.0.0 0 -persistenceType NONE -state DISABLED -redirectURL https://www.example.com -cltTimeout 180
Note: One of these vservers serves all the client requests and the other only performs URL redirection. The second vserver is disabled because the sole purpose of the server is to redirect URLs.


3. Run the following command to create a policy that matches a specific URL:
add cs policy <CS_POLICY_Name> -rule "REQ.HTTP.URL CONTAINS "example.com"

4. Run the following commands to create a content switching vserver:
add cs vserver <CS_HTTP_VSERVER_Name> HTTP 1.1.1.1 80
add cs vserver <CS_SSL_VSERVER_Name> SSL 1.1.1.1 443
Note: If you have already created a load balancing vserver, you must remove it before completing this step.
5. Run the following commands to bind together everything that you have created so far in this procedure:
bind cs vserver <CS_HTTP_VSERVER_Name> <First_LB_Server_Name>
bind cs vserver < CS_SSL_VSERVER_Name > <Second_LB_Server_Name> -policyName <CS_POLICY_Name>
bind cs vserver <CS_SSL_VSERVER_Name> <First_LB_Server_Name>


Note: In addition to the server, you must bind the appropriate services to the load balancing vservers and the SSL certificate pairs to the SSL content switching vserver.