Advanced Rule
Info: The Advanced Rule feature in Bloomreach Content requires a standard or premium license. Contact Bloomreach for licensing details.
Overview
The Advanced Rule configuration provides the following input fields and options:
- Description
- Conditions
- From
- To
- Case Sensitive
- Type
- Use Wildcard Matching
- Process other rules
- Append querystring
Description
Use this field to describe the purpose and function of the rule. A clear description helps others understand the rule's intent and supports searchability within the configuration interface.
Conditions
Specify the conditions that must be met for this rule to apply. The rule is only processed when all defined conditions are satisfied.
From
Enter a regular expression to match against incoming URLs. This field uses regular expressions unless you enable 'Use Wildcard Matching' (see below).
To
Define the target pattern for rewriting the matched portion of the URL. The rest of the URL remains unchanged. You can use backreferences, variables, and functions in this field.
Backreferences
| Backreference | Description |
|---|---|
| $N | References the Nth captured group from the 'From' regular expression. |
| %N | References the Nth captured group from the last matched Condition in this rule. |
Variables
| Variable | Example |
|---|---|
| ???scheme??? | Returns the scheme, such as http or https. Any valid condition type can be used as a variable name. |
Functions
| Function | Example | Output |
|---|---|---|
| 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 |
Case Sensitive
Enable this option to make the URL match case-sensitive. When selected, the rule distinguishes between uppercase and lowercase characters in the URL.
Type
Select the type of redirect or rewrite action to perform. The following types are available:
| Rule Type | HTTP Status Code / Behavior |
|---|---|
| temporary-redirect | Issues a 302 HTTP redirect. |
| permanent-redirect | Issues a 301 HTTP redirect. |
| forward | Internally forwards requests that match the conditions and the 'From' pattern to the URL specified in 'To'. |
| redirect | Issues an HTTP redirect for requests matching both the conditions and the 'From' pattern. |
| pre-include | |
| post-include | |
| proxy | Proxies the request to the full URL specified in 'To'. |
Use Wildcard Matching
Enable this option to use wildcard matching instead of regular expressions. A single asterisk (*) matches any single path element, and a double asterisk (**) matches multiple elements. For examples, see the Standard Rule documentation.
Process Other Rules
When enabled, the URL Rewriter continues processing subsequent rules after this rule succeeds. This behavior is similar to omitting the 'last' flag in Apache HTTPD mod_rewrite.
Append Query String
Enable this option to retain the original query string from the matched URL in the rewritten URL.
Known Issue:
The URL Rewriter may omit the question mark separator when appending the query string. To work around this, add a question mark at the end of the 'Rewrite To' field.