You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/rules/reference/page-rules-migration.mdx
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,18 +9,18 @@ import { Render, TabItem, Tabs, Example } from "~/components";
9
9
10
10
Cloudflare is continuously improving its platform to deliver more powerful and scalable tools for managing your configurations. To help you take full advantage of these improvements, we recommend using [modern Rules features](/rules/) for new implementations. These products address the limitations of Page Rules while providing greater flexibility, scalability, and ease of use.
11
11
12
-
For a quick start, explore the one-click templates available in the Rules tab of the dashboard. These templates simplify common configurations like redirects, rewrites and header modifications, making setup faster and easier.
12
+
For a quick start, explore the one-click templates available in the Cloudflare dashboard in **Rules** > **Templates**. These templates simplify common configurations like redirects, rewrites and header modifications, making setup faster and easier.
13
13
14
14
## Page Rules migration
15
15
16
-
To make the transition seamless, Cloudflare will handle the migration of your existing Page Rules automatically. This process is planned for **late 2025 or beyond**, with no action required on your part. You will receive advance notification before any changes are made.
16
+
To make the transition seamless, Cloudflare will handle the migration of your existing Page Rules automatically. This process is planned for late 2025 or beyond, with no action required on your part. You will receive advance notification before any changes are made.
17
17
18
18
If you wish to explore the benefits of modern Rules features sooner, you can begin adopting them today. Doing so allows you to:
19
19
20
20
- Take advantage of modern features and capabilities sooner.
21
21
- Customise and refine your rules to match your evolving needs.
22
22
23
-
To assist with this process, we've provided a comprehensive mapping between Page Rules settings and modern Rules products in this guide.
23
+
To assist with this process, we provide you with a comprehensive mapping between Page Rules settings and modern Rules products in this guide.
24
24
25
25
## Why transition?
26
26
@@ -39,20 +39,20 @@ Improvements in modern Rules features include:
39
39
40
40
The evaluation and execution order of Rules features is different from Page Rules:
41
41
42
-
-**Rule matching logic**: Page Rules apply the first matching rule *(first match wins)*. In contrast, modern Rules are stackable, meaning **multiple matching rules** can combine and apply to the same request *(last match wins)*. For example, if multiple Cache Rules match the same URL, the features in those rules will all apply in order.
43
-
-**Action separation**: A Page Rule may include multiple actions for different products that are applied in a **sequence** selected by the customer within the Page Rule itself. Modern Rules features are evaluated [in a fixed sequence](/rules/origin-rules/#execution-order), with customers defining the rule order within a product [phase](/ruleset-engine/reference/phases-list/).
44
-
-**Precedence**: Modern Rules features **take precedence** over Page Rules. For instance, if both define caching settings for the same path, Cache Rules will override Page Rules.
45
-
-**Caching behaviour**: In Cache Rules, selecting *Eligible for cache* automatically enables *Cache Everything* by default. To maintain the exact behaviour of Page Rules, you may need to [adjust your configuration](/cache/how-to/cache-rules/page-rules-migration/).
46
-
-**Interactions with Workers**: Requests handled by Workers will suppress Page Rules actions, but they **will not suppress** actions from modern Rules features.
42
+
-**Rule matching logic**: Page Rules apply the first matching rule (first match wins). In contrast, modern Rules are stackable, meaning multiple matching rules can combine and apply to the same request (last match wins). For example, if multiple cache rules match the same URL, the features in those rules will all apply in order.
43
+
-**Action separation**: A Page Rule may include multiple actions for different products that are applied in a sequence selected by the customer within the Page Rule itself. Modern Rules features are evaluated [in a fixed sequence](/rules/origin-rules/#execution-order), with customers defining the rule order within a product [phase](/ruleset-engine/reference/phases-list/).
44
+
-**Precedence**: Modern Rules features take precedence over Page Rules. For instance, if both define caching settings for the same path, Cache Rules will override Page Rules.
45
+
-**Caching behavior**: In Cache Rules, selecting **Eligible for cache** automatically enables **Cache Everything** by default. To maintain the exact behavior of Page Rules, you may need to [adjust your configuration](/cache/how-to/cache-rules/page-rules-migration/).
46
+
-**Interactions with Workers**: Requests handled by Workers will suppress Page Rules actions, but they will not suppress actions from modern Rules features.
47
47
48
48
## Convert Page Rules URLs to filter expressions
49
49
50
50
Modern Rules use filter expressions instead of URL patterns. These expressions, built with the Rules language, allow greater precision by leveraging [fields](/ruleset-engine/rules-language/fields/), [functions](/ruleset-engine/rules-language/functions/), and [operators](/ruleset-engine/rules-language/operators/).
51
51
52
-
The following example demonstrates the use of the `http.request.full_uri`[field](/ruleset-engine/rules-language/fields/standard-fields/#httprequestfull_uri) and the `wildcard` operator for [wildcard matching](/ruleset-engine/rules-language/operators/#wildcard-matching):
52
+
The following example demonstrates the use of the [`http.request.full_uri`](/ruleset-engine/rules-language/fields/standard-fields/#httprequestfull_uri) field and the `wildcard` operator for [wildcard matching](/ruleset-engine/rules-language/operators/#wildcard-matching):
53
53
54
54
<Example>
55
-
A **Page Rules URL** like
55
+
A **Page Rules URL** like:
56
56
57
57
`example.com/*/downloads/*.txt`
58
58
@@ -64,14 +64,15 @@ becomes a **filter expression** such as:
64
64
[Single Redirects](/rules/url-forwarding/single-redirects/create-dashboard/) and [Rewrite URL](/rules/transform/url-rewrite/create-dashboard/) rules also offer a simplified view called **Wildcard pattern**, allowing you to specify URL patterns (`http*://example.com/*/downloads/*.txt*`) without specifying the full filter expression (`http.request.full_uri wildcard "http*://example.com/*/downloads/*.txt*"`).
65
65
66
66
### Important considerations
67
-
-**Protocol scheme**: Page Rules URL matching does not include the URI scheme (for example, `http://` or `https://`) unless explicitly included in the rule. Filter expressions using `http.request.full_uri` field, however, require matching the full URI, including the protocol scheme. To make your filter expression scheme-agnostic, use `http*://` as a wildcard for both `http://` and `https://`.
68
-
-**Query strings**: Page Rules ignore query strings unless they are part of the rule URL. Filter expressions include the query string automatically, as part of the `http.request.full_uri` field. To ensure query strings do not affect your matching, append a `*` wildcard at the end of your filter expression, such as `.txt*`.
67
+
68
+
-**Protocol scheme**: Page Rules URL matching does not include the URI scheme (for example, `http://` or `https://`) unless explicitly included in the rule. Filter expressions using `http.request.full_uri` field, however, require matching the full URI, including the protocol scheme. To make your filter expression scheme-agnostic, use `http*://` as a wildcard for both `http://` and `https://`.
69
+
-**Query strings**: Page Rules ignore query strings unless they are part of the rule URL. Filter expressions include the query string automatically, as part of the `http.request.full_uri` field. To ensure query strings do not affect your matching, append a `*` wildcard at the end of your filter expression, such as `.txt*`.
69
70
70
71
## Feature correspondence table
71
72
72
73
To help you map existing Page Rules to modern Rules products, this table outlines how Page Rules settings translate to modern Rules and provides examples for common configurations.
73
74
74
-
Also, to streamline common configurations, the Rules tab in the dashboard now includes dozens of **one-click templates**. These templates enable you to deploy commonly used features — like redirects, rewrites, header modifications and more — instantly, with pre-filled filter expressions and actions. Explore these templates in the dashboard for a faster setup.
75
+
Also, to streamline common configurations, the Cloudflare the dashboard now includes dozens of one-click templates, available in **Rules** > **Templates**. These templates enable you to deploy commonly used features — such as redirects, rewrites, and header modifications — instantly, with pre-filled filter expressions and actions. Explore these templates in the dashboard for a faster setup.
0 commit comments