ADC

Configure URL transformation profiles

A profile describes a specific URL transformation as a series of actions. The profile functions primarily as a container for the actions, determining the order in which the actions are performed. Most transformations transform an external hostname and optional path into a different, internal hostname and path. Most useful transformations are simple and require only a single action, but you can use multiple actions to perform complex transformations.

You cannot create actions and then add them to a profile. You must create the profile first, and then add actions to it. In the CLI, creating an action and configuring the action are separate steps. Creating a profile and configuring the profile are separate steps in both the CLI and the configuration utility.

To create a URL transformation profile by using the NetScaler command line

At the NetScaler command prompt, type the following commands, in the order shown, to create a URL transformation profile and verify the configuration. You can then repeat the second and third commands to configure additional actions:

  • add transform profile <profileName> -type URL [-onlyTransformAbsURLinBody (ON|OFF)] \[-comment <comment>]
  • add transform action <name> <profileName> <priority>
  • set transform action <name> [-priority <priority>] [-reqUrlFrom <expression>] [-reqUrlInto <expression>] [-resUrlFrom <expression>] [-resUrlInto <expression>] [-cookieDomainFrom <expression>] [-cookieDomainInto <expression>] [-state (ENABLED|DISABLED)] [-comment "<string>"]
  • show transform profile <name>

Example:

> add transform profile shoppingcart -type URL
 Done
> add transform action actshopping shoppingcart 1000
 Done
> set transform action actshopping -priority 1000 -reqUrlFrom 'shopping.example.com' -reqUrlInto 'www.example.net/shopping' -resUrlFrom 'www.example.net/shopping' -resUrlInto 'shopping.example.com' -cookieDomainFrom 'example.com' -cookieDomainInto 'example.net' -state ENABLED -comment 'URL transformation for shopping cart.'
 Done
> show transform profile shoppingcart
        Name: shoppingcart
                Type: URL       onlyTransformAbsURLinBody: OFF
        Comment:
        Actions:

1)              Priority 1000   Name: actshopping       ENABLED
 Done
<!--NeedCopy-->

To modify an existing URL transformation profile or action by using the NetScaler command line

At the NetScaler command prompt, type the following commands to modify an existing URL transformation profile or action and verify the configuration:

Note: Use a set transform profile or set transform action command, respectively. The set transform profile command takes the same arguments as does the add transform profile command, and set transform action is the same command that was used for initial configuration.

  • set transform action <name> [-priority <priority>] [-reqUrlFrom <expression>] [-reqUrlInto <expression>] [-resUrlFrom <expression>] [-resUrlInto <expression>] [-cookieDomainInto <expression>] [-state (ENABLED|DISABLED)] [-comment "<string>"]
  • show transform profile <name>

Example:

> set transform action actshopping -priority 1000 -reqUrlFrom 'searching.example.net' -reqUrlInto 'www.example.net/searching' -resUrlFrom 'www.example.net/searching' -resUrlInto 'searching.example.com' -cookieDomainInto 'example.net' -state ENABLED -comment 'URL transformation for searching cart.'
 Done
> show transform profile shoppingcart
        Name: shoppingcart
                Type: URL       onlyTransformAbsURLinBody: OFF
        Comment:
        Actions:

1)              Priority 1000   Name: actshopping       ENABLED
 Done
<!--NeedCopy-->

To remove a URL transformation profile and actions by using the NetScaler command line

First remove all actions associated with that profile by typing the following command once for each action:

  • rm transform action <name> After you have removed all actions associated with a profile, remove the profile as shown below.
  • rm transform profile <name>

To create a URL transformation profile by using the configuration utility

  1. In the navigation pane, expand Rewrite, expand URL Transformation, and then click Profiles.
  2. In the details pane, click Add.
  3. In the Create URL Transformation Profile dialog box, type or select values for the parameters. The contents of the dialog box correspond to the parameters described in “Parameters for configuring URL transformation profiles” as follows (asterisk indicates a required parameter):
    • Name*—name
    • Comment—comment
    • Only transform absolute URLs in response body—onlyTransformAbsURLinBody
  4. Click Create, and then click Close. A message appears in the status bar, stating that the Profile has been configured successfully.

To configure a URL transformation profile and actions by using the configuration utility

  1. In the navigation pane, expand Rewrite, expand URL Transformation, and then click Profiles.
  2. In the details pane, select the profile you want to configure, and then click Open.
  3. In the Configure URL Transformation Profile dialog box, do one of the following.
    • To create a new action, click Add.
    • To modify an existing action, select the action, and then click Open.
  4. Fill in the Create URL Transformation Action or Modify URL Transformation Action dialog box by typing or selecting values for the parameters. The contents of the dialog box correspond to the parameters described in “Parameters for configuring URL transformation profiles” as follows (asterisk indicates a required parameter):
    • Action Name*—name
    • Comments—comment
    • Priority*—priority
    • Request URL from—reqUrlFrom
    • Request URL into—reqUrlInto
    • Response URL from—resUrlFrom
    • Response URL into—resUrlInto
    • Cookie Domain from—cookieDomainFrom
    • Cookie Domain into—cookieDomainInto
    • Enabled—state
  5. Save your changes.
    • If you are creating a new action, click Create, and then Close.
    • If you are modifying an existing action, click OK. A message appears in the status bar, stating that the Profile has been configured successfully.
  6. Repeat step 3 through step 5 to create or modify any additional actions.
  7. To delete an action, select the action, and then click Remove. When prompted, click OK to confirm the deletion.
  8. Click OK to save your changes and close the Modify URL Transformation Profile dialog box.
  9. To delete a profile, in the details pane select the profile, and then click Remove. When prompted, click OK to confirm the deletion.