You can add content rules to direct incoming requests for an HTTP or HTTPS service to one or more real servers, based on the host, URL, or other HTTP header fields of the request. If a request does not match any content rule, it is directed to a real server that has been added to the service.
When you create a content rule, enter the following patterns to match the requests that you want to be handled by the rule:
- Host Match – The host or domain name to match in the host header of the requests.
- URL Match – The URL to match in the URL header of the requests.
- Extended Match – An expression consisting of a combination of HTTP headers and/or query string parameters. The extended match pattern in a rule is evaluated only if the host and URL pattern are matched to the request. If a request does not match any extended match expressions for the rule, then the request is considered to have failed to match the rule. For more information on extended match and condition expressions, see Extended Match and Condition Expressions.
You can have multiple rules with the same host and URL match patterns but different extended match patterns. These rules are evaluated sequentially by the extended match sequence number that you assign to them.
If there are multiple content rules for a service, the rule that matches a request most closely is executed. For example, if a service has these two rules:
- Rule A – host www.example.com, URL /images/*
- Rule B – host www.example.com, URL /images/*.png
and the incoming request is for www.example.com/images/x.png, rule B is executed. If a rule has the most specific host and URL for a request, any Extended Match expressions for that rule are evaluated in the order established by the Extended Match Order field. If the request does not match any Extended Match expression for the rule then the request is considered to have failed to match any rule.
You can include
%s in the URL to redirect to the domain (URL) specified appending the same requested URL. For example,
- URL Match:
- Redirect URL:
When a request such as
is sent, it is redirected to
You can also use % in the URL to offset characters. For example,
- URL Match:
- Redirect URL:
Create a Content Rule
To create a content rule for an HTTP or HTTPS service:
- Go to the BASIC > Services page.
- In the left pane, select the service.
- Click the Add Content Rule option that appears.
- In the Add Content Rule window, enter a name for the rule, enter the patterns to match the requests that you want to be handled by the rule, and specify how the requests are distributed to the real servers for the rule.
- Click Create. The content rule settings appear in the main pane of the web interface.
- In the Configured Servers section, click Add Server to add and configure the real servers that you want to handle the requests that match the rule.