Redirect Handler

Purpose

The Redirect Handler permits the dynamic generation of an HTTP redirect response as a response to the current request.

If a request matches a predefined URL pattern, vWAF replaces this with a predefined character string. You can use regular expressions in this process (see Regular Expressions). Parts of the original can be also used for the replacement.

For more information regarding adding and editing Handlers, see Editing Handlers.

Severity

Events triggered by this handler are given the severity: low. (For details on severity levels, see Severity of Events Triggered by Handlers).

Recommendations for use

Use the Redirect Handler when specific URLs have been moved.

Attributes

Attribute Meaning

pattern

URL pattern to be replaced. You can specify the parts in brackets that are to be transferred over in the replacement process (see also Regular Expressions).

Example: /oldpath/(.*)

replace

New URL. The parts given in brackets under pattern can be used as a reference with \1, \2, ....

Example: /newpath/\1

In this example, a URL www.demosite.com/oldpath/test/index.html would be replaced by www.demosite.com/newpath/test/index.html, for example.

code

Select the HTTP Redirect Code from the list:

  • 301 (Moved Permanently)
  • 302 (Found)
  • 307 (Temporary Redirect)

usertext

Optional:

Here you can specify some text that vWAF adds to the log file entries created by this handler. You can use this, for example, to document why you've added the handler to your configuration, and how the handler is intended to behave.

enable logging

Disable this option if you do not want vWAF to create a log file entry when the handler is executed. This can be useful to keep log files smaller in case the handler creates a large number of entries but you don't need these entries.

When in detection mode, disabling logging de facto makes the handler ineffective. Disabling logging also prevents the actions of the handler from being taken into account for the Top-10 lists in Attack Analysis, and from being listed in Reports. To decrease the size of the log files, also consider to enable reduced logging, which excludes all non-handler-related information from the log files (see Editing Applications).

For details regarding entries added to the log file by this handler, see the relevant section in Entries in Application-Specific Log Files.