Secure Selected Pages



The Citrix NetScaler can be placed in front of a webserver farm that is running Apache. The same re-write rules that run on Apache, can be implemented on the Citrix NetScaler.

In situations where you want to make sure that for some selected pages only the secure server is used, the following can be used.


Apache rewrite:

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/?(page1|page2|page3|page4|page5)$  https:<span class="code-comment">//www.example.com/%1 [R,L]</span>



AppExpert rewrite example 1:

Add responder action res_redirect redirect  '<span class="code-quote">"https:<span class="code-comment">//www.example.com"</span>+HTTP.REQ.URL' -bypassSafetyCheck yes
</span>Add responder policy pol_redirect '!CLIENT.TCP.DSTPORT.EQ(443)&amp;&amp;HTTP.REQ.URL.REGEX_MATCH(re/page[1-5]/)'  res_redirect
Bind responder global pol_redirect 100 END



AppExpert rewrite example 2:

Add patset pat1
Bind patset pat1 page1
Bind patset pat1 page2
Bind patset pat1 page3
Bind patset pat1 page4
Bind patset pat1 page5
Add responder action res_redirect redirect  '<span class="code-quote">"https:<span class="code-comment">//www.example.com"</span>+HTTP.REQ.URL' -bypassSafetyCheck yes
</span>Add responder policy pol_redirect '!CLIENT.TCP.DSTPORT.EQ(443)&amp;&amp;HTTP.REQ.URL.CONTAINS_ANY(<span class="code-quote">"pat1"</span>)'  res_redirect
Bind responder global pol_redirect 100 END



Tap into the power of AppExpert!