Skip to content
Start here

Page Rules

resource cloudflare_page_rule

required Expand Collapse
zone_id: String

Identifier.

actions: List[Attributes]

The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both.

id?: String

If enabled, any http://`` URL is converted to https://` through a 301 redirect.

value?: String

The status of Automatic HTTPS Rewrites.

targets: List[Attributes]

The rule targets to evaluate on each request.

constraint?: Attributes

String constraint.

operator?: String

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

value: String

The URL pattern to match against the current request. The pattern may contain up to four asterisks ('*') as placeholders.

target?: String

A target based on the URL of the request.

optional Expand Collapse
priority?: Int64

The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.

status?: String

The status of the Page Rule.

computed Expand Collapse
id: String

Identifier.

created_on: Time

The timestamp of when the Page Rule was created.

modified_on: Time

The timestamp of when the Page Rule was last modified.

cloudflare_page_rule

resource "cloudflare_page_rule" "example_page_rule" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  priority = 0
  status = "active"
}

data cloudflare_page_rule

required Expand Collapse
pagerule_id: String

Identifier.

zone_id: String

Identifier.

computed Expand Collapse
id: String

Identifier.

created_on: Time

The timestamp of when the Page Rule was created.

modified_on: Time

The timestamp of when the Page Rule was last modified.

priority: Int64

The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.

status: String

The status of the Page Rule.

actions: List[Attributes]

The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both.

id: String

If enabled, any http://`` URL is converted to https://` through a 301 redirect.

value: String

The status of Automatic HTTPS Rewrites.

targets: List[Attributes]

The rule targets to evaluate on each request.

constraint: Attributes

String constraint.

operator: String

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

value: String

The URL pattern to match against the current request. The pattern may contain up to four asterisks ('*') as placeholders.

target: String

A target based on the URL of the request.

cloudflare_page_rule

data "cloudflare_page_rule" "example_page_rule" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  pagerule_id = "023e105f4ecef8ad9ca31a8372d0c353"
}