How to set up edge rules?

To set up edge rules, go to the ‘CDN’ > 'Multi CDN' > 'Edge rules', then click the ‘Add edge rule’ button.

The following are the two simple steps to set up edge rules.

Step 1: Set up edge rule conditions

First, enter a rule name. Then you can specify the field, operator, and their corresponding values.

Field  Field value Operator  Operator value
Parameter in REQUEST/GET/POST Parameter name Check this article Parameter value
Any parameter in REQUEST/GET/POST n/a Check this article Parameter value
# of parameters in REQUEST/GET/POST Parameter value =, >=, >, < Integer
# of all parameters in REQUEST/GET/POST n/a =, >=, >, < Integer
Parameter name in REQUEST/GET/POST n/a Check this article Parameter name
# of parameter names in REQUEST n/a =, >=, >, < Integer
Method in REQUEST n/a Check this article Method
Header in REQUEST Header name Check this article Header value
Any header in REQUEST n/a Check this article Header value
# of header in REQUEST Header value =, >=, >, < Integer
# of all headers in REQUEST n/a =, >=, >, < Integer
Header name in REQUEST n/a Check this article Header name
URI in REQUEST w/ query string n/a Check this article URI value
URI in REQUEST w/ query string n/a Check this article URI value
Geo location n/a Include, exclude Country

Field and operator definitions:

  • REQUEST means request from any methods, i.e. it can be a GET request, POST request, PUT request, etc. 
  • GET (or POST) specifically means a GET (or POST) request (not just any request method).
  • = means equal, >= means not equal, > means greater than, and < means less than.
  • Include and exclude means what they meant, i.e to include and to exclude.

Field and operator value definitions:

  • Parameter is what comes after “?” in a URL. Given a parameter: color=blue, the parameter name is “color”, and the parameter value is “blue”.
  • Method means request method, e.g. GET, POST, PUT, DELETE, CONNECT, etc.
  • There are 3 kinds of headers: General headers, Request headers, and Response headers. Header name/value in REQUEST means, a header name/value on request header, e.g. header name: header value, host: developer.mozilla.org, user-agent: Mozilla/5.0, accept: application/xhtml+xml, etc.

You can add more conditions by pressing the ‘+’ button. You can also delete a condition by pressing the ‘Trash’ icon on the right hand side of the condition.

You can see the summary description of the conditions you created beside the ‘Hand pointer’ icon.

Step 2: Set up edge rule actions

A specific action will be executed when the user request matches the condition/s you set above are met. 

You can set the specific actions by choosing one of the following: Redirect, Replace, and Force HTTPS. 

  • Redirect: Mlytics will redirect the request when the conditions are met. You can set the redirect status code (30x), and the link which is the URL where you want to redirect the request to.
  • Replace: Mlytics will replace the header value of a given request/response header name when the condition/s are met.
  • Force HTTPS: Mlytics will enable HTTPS connection when the conditions are met. This will redirect users to the secured HTTPS version of the website (As long as the website has an SSL certificate).

After you finish setting the conditions and actions, click the ‘Create’ button to create the edge rule.