> ## Documentation Index
> Fetch the complete documentation index at: https://developers.aptranet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delivery rules

> Override delivery behavior for matching URL paths with distribution rules.

Delivery rules apply selected configuration overrides to matching paths on a distribution. Use them when one application needs different caching, headers, or origin behavior for different URLs.

Open the distribution's **Rules** page to list, create, edit, enable, or remove rules. Each distribution supports up to five rules.

## Configure a rule

Set a descriptive name, path pattern, priority weight, and active state. Choose an origin-protocol override if required, then configure only the supported options for that rule. Disabled rules remain saved without being applied.

Read the current configuration before editing. API updates replace the rule configuration, so preserve the settings you want to keep. Test both matching and nonmatching URLs and inspect their response headers before using the rule for production traffic.

## API

Use `/cloud-cdn/distributions/rules?distribution=42`. GET returns `rules` and `limit`. POST creates a rule. PUT and DELETE also require the `rule` query parameter. Writes require **Modify distribution** permission.

A write body contains `name`, `pattern`, `weight`, `active`, `origin_protocol`, and `options`. An empty origin protocol inherits the distribution's setting. The API validates supported option names and shapes; unknown options are rejected. Rule-level Brotli requires Origin Shield to be enabled.

For application security policies, use [Cloud Shield rules](/cloud-shield/policies-and-rules).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.