There are several different ways to issue a standard (302) redirect using the netscaler. Prior to the responder module (introduced in V8 I believe), the most common method was to use a LB vserver to redirect the traffic. An example of that configuration can be found here
http://www.netscalerkb.com/netscaler_tricks_and_guides/url_redirection_using_content_switching-t25.0.html thanks to jmelika.
An alternate way is to use the responder module, which I actually prefer. The reason I prefer the responder is because it keeps my list of LB vservers clean (not riddled with redirects), and it keeps all of my redirects in one place. For someone like me, who has quite a few redirects, keeping my redirects organized and in one spot is a huge plus.
The scenario is this, you want all traffic coming in on
http://www.site.com to be redirected to
https://www.site.com. You could accomplish this with a simple responder policy and action.
First add your responder action.
add responder action responder_action1 respondwith '"HTTP/1.1 302 Object Moved\r\n" + "Location: https://www.site.com" + "\r\n"'Next add your responder policy and bind it to the action created above.
add responder policy responder_policy1 'HTTP.REQ.HEADER("Host").CONTAINS("www.site.com")' responder_action1Once you do this, you need you need to bind the policy. Note that binding this type of redirect globally can create an endless loop, so I do not recommend using a global bind. Instead, bind this policy to the appropriate HTTP vserver (either CS or LB). When the policy is evaluated, the traffic will be redirected to your SSL vserver, avoiding the endless loop.
To bind your responder policy to your CS vserver you can use:
bind cs vserver YOUR_VSERVER_NAME -policy repsonder_policy1 -priority 1Note that you might need to change the priority for your environment.
Using the same scenario as above, say you still want to redirect everything to HTTPS, however you want to preserve your URI string (i.e.
http://www.site.com/landing will redirect to
https://www.site.com/landing). To preserve the URI path you can use this in your action: HTTP.REQ.URL.PATH
So your new action would look like this:
add responder action responder_action1 respondwith '"HTTP/1.1 302 Object Moved\r\n" + "Location: https://www.site.com" + HTTP.REP.URL.PATH + "\r\n"'Jeremy