Citrix

How to Use URL Transformation to Rewrite and Proxy Requests

  • CTX124732
  • Created onMar 26, 2014
  • Updated onSep 19, 2014
Article Topic Networking

Objective

This article describes how to use URL transformation to rewrite and proxy requests.

Background

The rewrite/proxy function in Apache can be used to funnel requests to a host from a different domain, and change it to appear as if it is coming from the same host. One of the practical application of this feature is when you have content being pulled from different locations, and javascripts are being used, the browser might not allow it to prevent cross-site scripting attacks. It is possible to use the NetScaler appliance to emulate the rewrite/proxy function in Apache.

Requirements

For this function to work properly, the rewrite and content switching functions must be enabled on the NetScaler appliance. The appliance must be installed with NetScaler software release 9.0 or later to take advantage of the URL transform feature.

Instructions

To implement the same function as the Apache rewrite rule use the following procedure.

RewriteRule ^http://www.example.com/key/(.*) http://www.external.com/$1 [P,L]

This procedure takes incoming request for www.example.com, identified by the /key/ directory, and rewrites them to host www.external.com, removing the /key/ directory.

  1. Define a content switching virtual server which routes the incoming request to the IP of www.external.com.

  2. Configure the URL transformation as fol