Show TOC

Filtering URLsLocate this document in the navigation structure

Use

Incoming HTTP requests can be filtered before they are forwarded to the application server. Filtered URLs are not passed to the application server. HTTP status code 403 (forbidden) or 410 (gone) is returned to the HTTP client of the HTTP request.

A line in the action file describes precisely one modification action. The sequence in the action file defines the sequence of execution too. You can define multiple URL filters consecutively in the action file. If an HTTP request is filtered, the execution of the modification actions in the action file stops. You can link the execution of URL modifications to one or more conditions. For example, you can restrict URL filters to specific clients, protocols, times, etc.

Integration

Use the following syntax to define a URL redirect in the action file:

<operation> <pattern> <dest> [<option>]
         

The operation is case-insensitive.

Explanation of the Syntax

<operation>

  • RegForbiddenURL: The pattern match is case-sensitive. If the pattern matches, HTTP status code 403 (forbidden) is returned to the HTTP client.

  • RegIForbiddenURL: The pattern match is not case sensitive. If the pattern matches, HTTP status code 403 (forbidden) is returned to the HTTP client.

  • RegGoneURL: The pattern match is case-sensitive. If the pattern matches, HTTP status code 401 (gone) is returned to the HTTP client.

  • RegIGoneURL: The pattern match is not case sensitive. If the pattern matches, HTTP status code 401 (gone) is returned to the HTTP client.

<pattern>

Pattern used for the comparison. If the pattern matches, the appropriate HTTP status code (gone or fobidden) is returned to the HTTP client.

<dest>

The replacement expression does not affect the response sent to the HTTP client. Specify one " - " (minus sign).

[<option>]

  • noescape: In this case the result is not URL-encoded. By default the result is always URL-encoded (substitution of special characters: %, /, &). This option is only useful with URL rewrites and URL redirects.

  • restart: Restarts with the first modification action defined. Modification actions already executed remain valid.

  • break:Subsequent modification actions are no longer executed.

You can specify multiple options consecutively; you separate them using commas. The use of compound (grouping of single modification actions into one block) and skip (skipping modification actions) is no longer recommended.

Example

Example A:

Excerpt from the Action File:

RegIForbiddenUrl ^/ping(.*) -
            

If a pattern match is successful (all HTTP requests start with /ping; case-insensitive), the HTTP request is rejected.

Example B:

Excerpt from the Action File:

RegIGoneUrl ^/oldpath(.*) -
            

If a pattern match is successful, (HTTP request begins with /oldpath), a message stating that this URL no longer exists is sent to the HTTP client.