Actions
The action of a rule tells Cloudflare how to handle matches for the rule expression.
The table below lists the actions available in the Rules language.
Some actions like Block, called terminating actions, will stop the evaluation of the remaining rules. The Skip action will skip the evaluation of some rules when there is a match, but the exact behavior will depend on the rule configuration.
The available actions depend on the phase where you are configuring the rule. Refer to each product’s documentation for details on the phase(s) supported by that product.
Action | Description | Terminating action? |
---|---|---|
Interactive Challenge API value: | Useful for ensuring that the visitor accessing the site is human, not automated. The client that made the request must pass an interactive challenge. If successful, Cloudflare accepts the matched request; otherwise, it is blocked. | Yes |
JS Challenge API value: | Useful for ensuring that bots and spam cannot access the requested resource; browsers, however, are free to satisfy the challenge automatically. The client that made the request must pass a Cloudflare JavaScript Challenge before proceeding. If successful, Cloudflare accepts the matched request; otherwise, it is blocked. | Yes |
Managed Challenge (Recommended) API value: | Helps reduce the lifetimes of human time spent solving CAPTCHAs across the Internet. Depending on the characteristics of a request, Cloudflare will dynamically choose the appropriate type of challenge from the following actions based on specific criteria:
| Yes |
Block API value: | Matching requests are denied access to the site. | Yes |
Skip API value: | Allows user to dynamically skip one or more security features or products for a request. Depending on the rule configuration, matching requests will skip the evaluation of one or more security features or products:
The available skip options depend on the phase where you configure the rule. Refer to each product’s documentation for details. | No (but some rules may be skipped) |
Log API value: | Records matching requests in the Cloudflare Logs. Only available on Enterprise plans. Recommended for validating rules before committing to a more severe action. | No |
Execute API value: | Executes the rules in the ruleset specified in the rule configuration. You can specify a managed ruleset or a custom ruleset to execute. In the Cloudflare dashboard, this action is not listed in action selection dropdowns. | No |
Rewrite API value: | Adjusts the URI path, query string, and/or HTTP headers of requests and responses, according to the rule configuration. Only available in:
| No |
Redirect API value: | Navigates the user from a source URL to a target URL, according to the rule configuration, by replying with an HTTP redirect. Only available for Single Redirects and Bulk Redirects. In the Cloudflare dashboard, this action is not listed in action selection dropdowns. To use this action, create a redirect rule or a bulk redirect rule. | Yes |
Route API value: | Adjusts the Only available for Origin Rules, in the In the Cloudflare dashboard, this action is not listed in action selection dropdowns. To use this action, create an origin rule. | No |
Set Configuration API value: | Changes the configuration settings of one or more Cloudflare products. Only available for Configuration Rules, in the In the Cloudflare dashboard, this action is not listed in action selection dropdowns. To use this action, create a Configuration Rule. | No |
Compress Response API value: | Defines compression settings for delivering responses to website visitors. Only available for Compression Rules, in the In the Cloudflare dashboard, this action is not listed in action selection dropdowns. To use this action, create a compression rule. | No |
Set Cache Settings API value: | Cache Rules allows you to customize cache settings on Cloudflare. Only available for Cache Rules, in the In the Cloudflare dashboard, this action is not listed in action selection dropdowns. To use this action, create a cache rule. | No |