Manage HTTP Translations

The Manage HTTP Translations page enables you to perform the following procedures:

Adding a map rule:

The map rule specifies that if a component of a URL matches the Template field, the request is mapped to another directory on the same host as defined in the Result field.

Conditions

If you use asterisks (*) as wildcard characters in the Template field, the wildcard character matches zero or more characters, including the slash (/) character.

If you use asterisks as wildcard characters in the Result field, the wildcard character represents the text expanded from the match in the Template field. You should include the wildcard character in the Result field only if you use a wildcard in the Template field.

If you use multiple wildcard characters, the first one in the Result field corresponds to the first one in the Template field, the second one in the Result field corresponds to the second one in the Template field, and so on.

To add a map rule, complete the following steps:

  1. Click in the Editor box where you want the rule to be placed.

  2. Click Insert.

  3. In the Command field, select Map.

  4. In the Template field, enter a component of a URL against which to match.

  5. In the Result field, enter the URL to which to define the request being mapped on another directory.

  6. In the Comment field, enter an optional comment about this rule.

  7. Click OK to save the rule.

Example

The following map rule entry in the /etc/httpd.translations file causes any requests to a URL containing the /image-bin directory to be mapped to the /usr/local/http/images directory.

Adding a redirect rule:

The redirect rule specifies that if a component of a URL matches the template, the request is redirected to the URL defined in the Result field.

Conditions

If you use asterisks (*) as wildcard characters in the Template field, the wildcard character matches zero or more characters, including the slash (/) character.

If you use asterisks as wildcard characters in the Result field, the wildcard character represents the text expanded from the match in the Template field. You should include the wildcard character in the Result field only if you use a wildcard in the Template field.

If you use multiple wildcard characters, the first one in the Result field corresponds to the first one in the Template field, the second one in the Result field corresponds to the second one in the Template field, and so on.

To add a redirect rule, complete the following steps:

  1. Click in the Editor box where you want the rule to be placed.

  2. Click Insert.

  3. In the Command field, select Redirect.

  4. In the Template field, enter a component of a URL.

  5. In the Result field, enter an optional URL to which the request is to be redirected.

  6. In the Comment field, enter an optional comment about this rule.

  7. Click OK to save the rule.

Example

The following redirect rule entry in the /etc/httpd.translations file causes the filer to redirect Common Gateway Interface (CGI) requests to another HTTP server, named cgi-host. This is essential for calls to the /cgi-bin directory because the filer does not execute CGI requests.

Adding a pass rule:

The pass rule specifies that if a component of a URL matches the template, the filer accepts the request, processes the request as is, and disregards other rules.

Conditions

If you use asterisks (*) as wildcard characters in the Template field, the wildcard character matches zero or more characters, including the slash (/) character.

If you use asterisks as wildcard characters in the Result field, the wildcard character represents the text expanded from the match in the Template field. You should include the wildcard character in the Result field only if you use a wildcard in the Template field.

If you use multiple wildcard characters, the first one in the Result field corresponds to the first one in the Template field, the second one in the Result field corresponds to the second one in the Template field, and so on.

To add a redirect rule, complete the following steps:

  1. Click in the Editor box where you want the rule to be placed.

  2. In the Command field, select Pass.

  3. In the Template field, enter a component of a URL.

  4. In the Result field, enter an optional URL to which the request is redirected.

  5. In the Comment field, enter an optional comment about this rule.

  6. Click OK to save the rule.

Example

The following pass rule entry in the /etc/httpd.translations file causes the filer to process the request for any URL containing the /image-bin directory as is. If the pass rule includes the Result field, the filer accepts the request, processes the request by using the URL defined in the Result field, and disregards other rules.

Adding a fail rule:

The fail rule specifies that if a component of a URL matches the template, the filer denies access to that component and disregards other rules.

Condition

If you use asterisks (*) as wildcard characters in the Template field, the wildcard character matches zero or more characters, including the slash (/) character.

To add a fail rule, complete the following steps:

  1. Click in the Editor box where you want the rule to be placed.

  2. Click Insert.

  3. In the Command field, choose Fail.

  4. In the Template field, enter a component of a URL.

  5. In the Comment field, enter an optional comment about this rule.

  6. Click OK to save the rule.

Example

The following fail rule entry in the /etc/httpd.translations file causes the filer to deny access to the /user/forbidden directory.

Related Topics