Moved Document Root

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.

Usually the Document Root of the web server directly relates to the URL “/”. But in some cases the document root should shift to some other directory. The following rules can be used to implement this.

Example : Rewrite the url / to /e/www

Apache rewrite:

RewriteEngine on
RewriteRule   ^/$  /e/www/  [R]

AppExpert rewrite: (There are two ways to do this)

“solution 1”
add responder action act1 redirect '<span class="code-quote">"/e/www/"</span>' -bypassSafetyCheck yes
add responder policy pol1 'HTTP.REQ.URL.EQ(<span class="code-quote">"/"</span>)' act1
bind responder global pol1 100
“Solution 2”
add responder action act1 redirect '<span class="code-quote">"/e/www"</span>+HTTP.REQ.URL' -bypassSafetyCheck yes
add responder policy pol1 '!HTTP.REQ.URL.STARTSWITH(<span class="code-quote">"/e/www/"</span>)' act1
bind responder global pol1 100 END

Tap into the power of AppExpert!