This type of rule will present you with three input fields and a couple of checkboxes, namely:
- Description - Conditions - From - To - Case Sensitive - Type - Use Wildcard Matching - Process Other Rules - Append Query String
This field is meant to provide a clear description of the rule, so it's clear for other people what it does and why it was created. This will also help you to find it later using the search.
These conditions must match for this rule to be processed, click here for the documentation.
Here you can enter the regular expression that the incoming URL will be matched against. (Assuming 'Use Wildcard Matching' is unchecked, see below)
What the matched part of the URL will be rewritten to, all other parts of the URL will remain intact. It can contain backreferences, variables and functions.
Backreference | Explanation |
---|---|
$N | Provides access to the grouped parts (parentheses) of the pattern from the 'From' field. |
%N | Provides access to the grouped parts (parentheses) of the pattern from the last matched Condition in the current rule. |
Variable | Example |
---|---|
%{scheme} | Will return either http or https. Any valid condition type can be used as a variable name. |
Function | Example | Example would return |
---|---|---|
replace | ${replace:my cat is a blue cat:cat:dog} | my dog is a blue dog |
replaceFirst | ${replaceFirst:my cat is a blue cat:cat:dog} | my dog is a blue cat |
escape | ${escape:a b c} | a+b+c |
unescape | ${unescape:a+b+c} | a b c |
lower | ${lower:Hello World} | hello world |
upper | ${upper:hello} | HELLO |
trim | ${trim: abc def } | abc def |
What type of redirect should take place.
Rule Type | HTTP status code |
---|---|
temporary-redirect | Redirect with 302 response code |
permanent-redirect | Redirect with 301 response code |
forward | Requests matching the "conditions" for this "rule", and the URL in the "from" element will be internally forwarded to the URL specified in the "to" element. |
redirect | Requests matching the "conditions" and the "from" for this rule will be HTTP redirected |
pre-include | |
post-include | |
proxy | The request will be proxied to the full url specified |
Use wildcard matching instead of regular expressions. A single wildcard (*) will match any single element, ** will match all elements. See this page for some examples.