How to Redirect HTTP to HTTPS Including Hostname on NetScaler

How to Redirect HTTP to HTTPS Including Hostname on NetScaler

book

Article ID: CTX220266

calendar_today

Updated On:

Description

This article describes how to rewrite an HTTP request http://xyx.com as http://www.xyz.com and then to https://www.xyz.com.


Instructions

1. Enable Responder Feature on NetScaler using the following command:

enable ns feature Responder

 

2. Create a Responder Action using the following command:

add responder action HTTP_TO_HTTPS_HOSTNAME redirect "\"https://\"+\"www.\"+HTTP.REQ.HOSTNAME.HTTP_URL_SAFE" -responseStatusCode 302

 

3. Configure Responder Policy using the following command:

add responder policy HTTP_TO_HTTPS_HOSTNAME_POLICY "HTTP.REQ.HOSTNAME.CONTAINS(\"www\").NOT" HTTP_TO_HTTPS_HOSTNAME

 

4. Bind the responder policy to your existing HTTP vServer: 

bind lb vserver Your_HTTP_LB_vS -policyName HTTP_TO_HTTPS_HOSTNAME_POLICY -priority 100

 

For more information, please see How to redirect HTTP request to HTTPS using responder

Issue/Introduction

This article describes how to rewrite an HTTP request http://xyx.com as http://www.xyz.com and then to https://www.xyz.com.