Overview

Namespaces

  • Cloudflare
    • Organizations
      • Firewall
        • AccessRules
    • User
      • Billing
        • Subscriptions
      • Firewall
    • Zone
      • Firewall
      • SSL
      • WAF
        • Packages

Classes

  • Analytics
  • Cache
  • CustomPages
  • CustomSSL
  • Dns
  • KeylessSSL
  • Pagerules
  • Plan
  • Railgun
  • Settings
  • SSL
  • Overview
  • Namespace
  • Class

Class Pagerules

CloudFlare API wrapper

Page rules for a Zone A rule describing target patterns for requests and actions to perform on matching requests

Cloudflare\Api
Extended by Cloudflare\Zone\Pagerules
Namespace: Cloudflare\Zone
Author: James Bell james@james-bell.co.uk
Version: 1
Located at CloudFlare/Zone/Pagerules.php
Methods summary
public
# create( string $zone_identifier, array $targets, array $actions, integer|null $priority = null, string|null $status = 'active' )

Create a page rule [BETA] (permission needed: #zone:edit)

Create a page rule [BETA] (permission needed: #zone:edit)

Parameters

$zone_identifier
API item identifier tag
$targets
Targets to evaluate on a request
$actions

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

$priority

A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.

$status
Status of the page rule
public
# list_pagerules( string $zone_identifier, string|null $status = null, string|null $order = null, string|null $direction = null, string|null $match = null )

List page rules [BETA] (permission needed: #zone:read)

List page rules [BETA] (permission needed: #zone:read)

Parameters

$zone_identifier
API item identifier tag
$status
Status of the page rule
$order
Field to order page rules by (status, priority)
$direction
Direction to order page rules (asc, desc)
$match
Whether to match all search requirements or at least one (any) (any, all)
public
# details( string $zone_identifier, string $identifier )

Page rule details [BETA] (permission needed: #zone:read)

Page rule details [BETA] (permission needed: #zone:read)

Parameters

$zone_identifier
API item identifier tag
$identifier
public
# change( string $zone_identifier, string $identifier, array|null $targets = null, array|null $actions = null, integer|null $priority = null, string|null $status = null )

Change a page rule [BETA] (permission needed: #zone:edit)

Change a page rule [BETA] (permission needed: #zone:edit)

Parameters

$zone_identifier
API item identifier tag
$identifier
$targets
Targets to evaluate on a request
$actions

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

$priority

A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.

$status
Status of the page rule
public
# update( string $zone_identifier, string $identifier, array $targets, array $actions, integer|null $priority = null, string|null $status = null )

Update a page rule [BETA] (permission needed: #zone:edit) Replace a page rule. The final rule will exactly match the data passed with this request.

Update a page rule [BETA] (permission needed: #zone:edit) Replace a page rule. The final rule will exactly match the data passed with this request.

Parameters

$zone_identifier
API item identifier tag
$identifier
$targets
Targets to evaluate on a request
$actions

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

$priority

A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.

$status
Status of the page rule
public
# delete_pagerule( string $zone_identifier, string $identifier )

Delete a page rule [BETA] (permission needed: #zone:edit)

Delete a page rule [BETA] (permission needed: #zone:edit)

Parameters

$zone_identifier
API item identifier tag
$identifier
Methods inherited from Cloudflare\Api
__construct(), delete(), get(), patch(), permissions(), post(), put(), request(), setAuthKey(), setCurlOption(), setEmail()
Properties summary
protected array $permission_level

Default permissions level

Default permissions level

# ['read' => '#zone:read', 'edit' => '#zone:edit']
Properties inherited from Cloudflare\Api
$auth_key, $curl_options, $email
API documentation generated by ApiGen