Fortinet 385 FortiWeb 5.0 Patch 6 Administration Guide
original request. The parts are determined by which capture group was matched in the Regular
Expression field of each condition table object.
$0 — The text that matched the first capture group (.*). In this case, because the object is
the Host: field, the matching text is the host name, www.example.com.
$1 — The text that matched the second capture group, which is also (.*). In this case,
because the object is the request URL, the matching text is the file path, news/local.
See also
Grouping rewriting & redirection rules
Example: Rewriting URLs using regular expressions
Example: HTTP-to-HTTPS redirect
Rewriting & redirecting
Regular expression syntax
What are back-references?
Cookbook regular expressions
Grouping rewriting & redirection rules
Before you can apply rewriting or redirection, you must first assemble the rules into prioritized
sets. (In the web UI, these are called “URL rewriting policies.”)
To configure a policy
1. Before you can URL rewriting policy, you must first configure one or more rewriting rules.
See “Rewriting & redirecting” on page 367.
2. Go to Application Delivery > URL Rewriting Policy > URL Rewriting Policy.
To access this part of the web UI, your administrator’s account access profile must have
Read and Write permission to items in the Web Protection Configuration category. For
details, see “Permissions” on page 47.
Table 41:Example URL rewrites using regular expressions
Example request URL Rewriting
Condition Table
Replacement URL Result
www.example.com HTTP Host (.*) Host $0 www.example.com
/news/local.asp HTTP URL /(.*)\.asp URL /$1.php /news/local.php