Configuring HTTP Error-redirect

To configure HTTP Error-redirect rule sets:

  1. Configure the redirect-rule statement at the http-manager hierarchy level to specify a name for this rule.

    In the following example, the redirect-rule statement is configured as rule2 .

  2. Configure the term statement at the http-manager hierarchy level to specify a numbered identity for each term in a rule. The term statement can be configured with an identity ranging from 1 through 255.

    In the following example, the term statement is configured as 2.

  3. Configure the http-status-code statement and specify a list of error codes to match this term. The HTTP status code from a response is compared against these values.

    In the following example, the http-status-code statement is configured as a from clause inside a term called 2 inside a redirect-rule called rule2.

  4. Configure the maximum-content-length statement and specify a threshold on the size of the HTTP response, in bytes.

    If the server’s response is less than or equal to this value, this term matches the response. If the server’s response is greater than this value, this term does not match the response. In the following example, the http-status-code statement is configured as a from clause inside a term called 2 inside a redirect-rule called rule2.

  5. Configure the redirect-302 statement and specify the URL of the landing page to be included in the 302 redirect message sent to clients.

    This is a string that contains the complete URL. The following escape characters can be used in the string:

    • %h - Escape character that will be replaced by the “hostname” HTTP header content of the original HTTP request that triggered this response.
    • %u - Escape character that will be replaced by the URI content of the original HTTP request that triggered this response.
  6. If you want to configure a rule set with multiple rules, configure the redirect-rule-set statement and specify the name for the rule set.

    A rule set is a collection of rules ordered in the sequence in which they are entered. Rule sets are evaluated in the order in which they are configured in a service set.

  7. Configure the service-set statement to create a service set for the error-redirect rules and rule sets you have created. See Configuring HTTP Content Management Service Sets for more information.

Configuring HTTP Error-redirect Rule sets

services {http-manager {redirect-rule rule2 {term 2 {from {http-status-code [ 403 404 ];maximum-content-length 50;}then {count;redirect-302 {location "%h/redirecturl.html";}}}}redirect-rule-set redirect1 {rule rule2;}}}

Related Documentation