Move Homedirs to Different Web Server



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.

There are cases when you want to redirect requests for homedirs on one web server to another web server. The typical use case for this arises when establishing a newer web server which will replace the old one over time. i.e. you need to redirect all the requests for a particular homedir to another web server.

Example : Let the hostname for new webserver be newserver.

Apache rewrite:

RewriteRule   ^/(.+)  http:<span class="code-comment">//newserver/$1     [R,L]</span>



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

“solution 1”
Add responder  action act1 redirect '<span class="code-quote">"http:<span class="code-comment">//newserver"</span>+HTTP.REQ.URL' -bypassSafetyCheck yes
</span>Add responder policy pol1 'HTTP.REQ.URL.REGEX_MATCH(re#^/(.+)#)'   act1
Bind responder global pol1 100 END
“Solution 2”
Add responder  action act1 redirect '<span class="code-quote">"http:<span class="code-comment">//newserver"</span>+HTTP.REQ.URL' -bypassSafetyCheck yes
</span>Add responder policy pol1 'HTTP.REQ.URL.LENGTH.GT(1)'   act1
Bind responder global pol1 100 END



Tap into the power of AppExpert!