Page Rules migration guide
Cloudflare recommends that you consider using modern Rules features for your new implementations instead of Page Rules. Follow the recommendations in this migration guide to learn about the new Rules products and how you can start adopting them today.
Cloudflare plans to migrate your existing Page Rules during 2025. You do not need to migrate your own rules, as Cloudflare will handle this process for you. However, it is beneficial to understand the correspondence between the different Page Rules settings and new Rules features ahead of the migration. This will help you familiarize yourself with implementing the new types of rules in your Cloudflare account.
We encourage you to explore and start using the new Rules products to take advantage of their enhanced capabilities and features. This migration guide will be updated in the coming months with additional information about the Page Rules migration. Some instructions may also change as we simplify configuration deployment and release new features as part of this project. Cloudflare users will receive email updates about the migration of the Page Rules configured on their Cloudflare account before the migration occurs. We will not perform any migration or changes on your behalf without prior notification.
Cloudflare Page Rules has several fundamental limitations, such as triggering solely based on URL patterns and being limited to 125 rules per zone for performance reasons. These rules are also complex to debug when multiple page rules apply to the same incoming request.
In 2022, we announced in our blog post The future of Page Rules ↗ that Page Rules would be replaced with a suite of dedicated products, each built to be best-of-breed and put more power into the hands of our users. The new Rules products — Configuration Rules, Compression Rules, Origin Rules, Redirects, and Transform Rules — are now generally available (GA) and have already been adopted by tens of thousands of Cloudflare customers.
Improvements in modern Rules features include:
- New engine: New Rules features are powered by the Ruleset Engine, which offers versatile configuration with a robust language that supports many HTTP request and response fields.
- Improved scalability: Thanks to the improved scalability, Cloudflare plans now have increased quotas.
- Easier troubleshooting: Rule execution is more predictable, since each rule operates independently, simplifying troubleshooting. Additionally, Cloudflare Trace helps understand rule interactions.
- Improved consistency: New Rules features also ensure consistency, with common fields and capabilities shared across products, offering a seamless experience and predictable Terraform configurations.
The evaluation and execution order of Rules features is different from Page Rules:
- Requests handled by Workers will suppress Page Rules actions, but they will not suppress actions from modern Rules features.
- The first Page Rule to match is applied (also called first match). In contrast, other rules like Cache Rules are stackable. This means that multiple matching rules can be combined and applied to the same request (last match). For example, if multiple cache rules match the same URL, then the features set in those cache rules will all be applied in order. For more information, refer to Order and priority in the Cache documentation and the Origin Rules FAQ.
- A Page Rule may include multiple configurations for different products that are applied in a sequence selected by the customer. In contrast, modern Rules features are evaluated in a fixed sequence, with a customer being able to define the rule order within a product phase. Refer to the Ruleset Engine documentation for more information.
- Modern Rules features will take precedence over Page Rules. For example, if you have Page Rules and Cache Rules defining caching settings for the same path, Cache Rules will take precedence.
There is a behavior change between Page Rules and Cache Rules: when you select Eligible for cache in a cache rule, the Cache Everything feature is now enabled by default.
If you need to keep the exact same behavior you had with Page Rules, you will need to make some additional configurations. For details, refer to Migration from Page Rules in the Cache documentation.
When migrating a Page Rule you will need to write a filter expression equivalent to your Page Rules URL using the Rules language.
Rule filter expressions are built differently from Page Rules URLs. You can use different elements of the Rules language in a filter expression, including fields, functions, and operators.
You will need to adapt your Page Rules URLs when migrating them to modern rules. In the Rules language, use the wildcard
and strict wildcard
operators (case insensitive and case sensitive operator, respectively) for wildcard matching. Enterprise and Business customers can use regular expressions, but it will also require adapting the original URLs in your Page Rules to regular expressions.
The Page Rules URL matching does not take into account the URI scheme (for example, https://
) and the query string of incoming requests, unless included in the rule URL. However, the http.request.full_uri
field used in filter expressions includes the URI scheme and the query string (when the incoming request includes one). When writing a filter expression equivalent to a Page Rule URL, you may want to perform wildcard matching on the full URI. To check for a match regardless of the URI scheme and query string, you can add a *
wildcard at the beginning and at the end of the literal string with wildcards.
For example, if you were using the Page Rules URL example.com/*/downloads/*.txt
, in modern Rules features you could use an expression such as http.request.full_uri wildcard *example.com/*/downloads/*.txt*
to make sure it matches any scheme and any query string.
Alternatively, you could match on individual hostname and URI path fields instead of the full URI field. For example, http.host eq "example.com" and http.request.uri.path wildcard "/*/downloads/*.txt"
. This was the conversion method followed in the table with example conversions from Page Rules URLs to filter expressions.
The following table lists the most common Page Rule URLs and their equivalent filters:
Target and components | Page Rule URL example | Filter expression using Rules language |
---|---|---|
Index page of root domain only (Domain + Path) | example.com/ | http.host eq "example.com" and http.request.uri.path eq "/" |
Everything on a specific domain (Domain) | example.com/* | http.host eq "example.com" |
All subdomains and URLs on a specific domain (Domain) | *example.com/* | http.host contains "example.com" |
Only subdomains and their URLs (Domain) | *.example.com/* | http.host contains ".example.com" |
Specific file on subdomains of a specific domain (Domain + Path) | *.example.com/*wp-login.php | ends_with(http.host, ".example.com") and ends_with(http.request.uri.path, "wp-login.php") |
Specific file extension in a directory or its subdirectories of a domain (Domain + Path) | example.com/archives/*.zip | http.host eq "example.com" and starts_with(http.request.uri.path, "/archives/") and http.request.uri.path.extension eq "zip" |
Specific file extension in any subdirectory of a domain (Domain + Path) | example.com/*/downloads/*.txt | http.host eq "example.com" and not starts_with(http.request.uri.path, "/downloads/") and http.request.uri.path contains "/downloads/" and http.request.uri.path.extension eq "txt" |
Specific directory and all its contents on all subdomains of a specific subdomain (Domain + Path) | *cdn.example.com/file/* | http.request.full_uri contains "cdn.example.com/file/" |
Specific URL on all domains (Path) | */images (required Cloudflare for SaaS) | http.request.uri.path eq "/images" |
Specific directory and its subdirectories on all domains (Path) | */images/* (required Cloudflare for SaaS) | starts_with(http.request.uri.path, "/images/") |
Specific file in any directory (Path) | */wp-login.php (required Cloudflare for SaaS) | ends_with(http.request.uri.path, "/wp-login.php") |
Specific query string on all domains (Path) | */*?country=GB (required Cloudflare for SaaS) | http.request.uri.query eq "country=GB" |
Part of a query string on all domains (Path) | */*?*country=GB* (required Cloudflare for SaaS) | http.request.uri.query contains "country=GB" |
The following table summarizes how different Page Rules settings will be migrated to other Rules features. You can refer to this table and the next sections to learn more about the new way of implementing a given Page Rules setting, and also to learn how you can manually migrate your existing Page Rules.
Page Rules setting | New implementation uses... | Migration/Replacement instructions |
---|---|---|
Always Use HTTPS | Redirect Rules (Single Redirects) | Migrate Always Use HTTPS |
Browser Cache TTL | Cache Rules | Migrate Browser Cache TTL |
Browser Integrity Check | Configuration Rules | Migrate Browser Integrity Check |
Bypass Cache on Cookie | Cache Rules | Migrate Bypass Cache on Cookie |
Cache By Device Type | Cache Rules | Migrate Cache By Device Type |
Cache Deception Armor | Cache Rules | Migrate Cache Deception Armor |
Cache Level | Cache Rules | Migrate Cache Level |
Cache on Cookie | Cache Rules | Migrate Cache on Cookie |
Cache TTL by status code | Cache Rules | Migrate Cache TTL by status code |
Custom Cache Key | Cache Rules | Migrate Custom Cache Key |
Disable Apps | Configuration Rules | Migrate Disable Apps |
Disable Performance | N/A (deprecated) | Replace Disable Performance |
Disable Railgun | N/A (deprecated) | N/A |
Disable Security | N/A (deprecated) | Replace Disable Security |
Disable Zaraz | Configuration Rules | Migrate Disable Zaraz |
Edge Cache TTL | Cache Rules | Migrate Edge Cache TTL |
Email Obfuscation | Configuration Rules | Migrate Email Obfuscation |
Forwarding URL | Redirect Rules (Single Redirects) | Migrate Forwarding URL |
Host Header Override | Origin Rules | Migrate Host Header Override |
IP Geolocation Header | Transform Rules (Managed Transforms) | Migrate IP Geolocation Header |
Mirage | Configuration Rules | Migrate Mirage |
Opportunistic Encryption | Configuration Rules | Migrate Opportunistic Encryption |
Origin Cache Control | Cache Rules | Migrate Origin Cache Control |
Origin Error Page Pass-thru | Cache Rules | Migrate Origin Error Page Pass-thru |
Polish | Configuration Rules | Migrate Polish |
Query String Sort | Cache Rules | Migrate Query String Sort |
Resolve Override | Origin Rules | Migrate Resolve Override |
Respect Strong ETags | Cache Rules | Migrate Respect Strong ETags |
Response Buffering | N/A (deprecated) | N/A |
Rocket Loader | Configuration Rules | Migrate Rocket Loader |
Security Level | Configuration Rules | Migrate Security Level |
True Client IP Header | Transform Rules (Managed Transforms) | Migrate True Client IP Header |
SSL | Configuration Rules | Migrate SSL |
Web Application Firewall | N/A (deprecated) | N/A |
Context:
You configured a Page Rule to perform an automatic redirect from HTTP to HTTPS for all subdomains of example.com
and the example.com
domain itself:
- URL
*example.com/*
- Setting: Always Use HTTPS
How to migrate:
-
Create a single redirect to always redirect HTTP requests to HTTPS. You can select the Redirect from HTTP to HTTPS rule template or enter the following rule configuration:
-
If incoming requests match: Wildcard pattern
- Request URL:
http://*
- Request URL:
-
Then:
- Target URL:
https://${1}
- Status code: 301
- Preserve query string: Enabled
- Target URL:
-
-
Turn off your existing Page Rule and validate the behavior of the redirect you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a single redirect |
---|---|
Context:
You configured a Page Rule turning on Automatic HTTPS Rewrites for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Automatic HTTPS Rewrites
- Value: On
How to migrate:
-
Create a configuration rule to always rewrite HTTP links to HTTPS for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Automatic HTTPS Rewrites
- Value: On
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule adjusting browser cache TTL to one day for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Browser Cache TTL
- Enter Browser Cache TTL: a day
How to migrate:
-
Create a cache rule to adjust browser cache TTL for caching resources in the browser to one day for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Browser TTL: Override origin and use this TTL
- Input time-to-live (TTL): 1 day
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on Browser Integrity Check for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Browser Integrity Check
- Value: On
How to migrate:
-
Create a configuration rule to turn on Browser Integrity Check for protecting against bots and threats for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Browser Integrity Check
- Value: On
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule turning on Bypass Cache on Cookie for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Bypass Cache on Cookie
- Enter value:
test_cookie
How to migrate:
-
Create a cache rule to bypass cache for requests containing cookie
test_cookie
for any hostname containingexample.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com" AND Cookie contains "test-cookie"
- Using the Expression Editor:
(http.host contains "example.com" and http.cookie contains "test-cookie")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Bypass cache
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on Cache By Device Type for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Cache By Device Type
- Value: On
How to migrate:
-
Create a cache rule to cache content based on user agent or device type for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Cache by device type: On
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on Cache Deception Armor for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Cache Deception Armor
How to migrate:
-
Create a cache rule to protect against cache deception attacks for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Cache deception armor: On
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on caching of all assets for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Cache Level
- Select Cache Level: Cache Everything
How to migrate:
-
Create a cache rule to adjust cache level for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on caching for responses that contained cookie test-cookie
for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Cache on Cookie
- Enter value:
test-cookie
How to migrate:
-
Create a cache rule to cache responses containing cookie
test_cookie
for any hostname containingexample.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com" AND Cookie contains "test-cookie"
- Using the Expression Editor:
(http.host contains "example.com" and http.cookie contains "test-cookie")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on caching of every response with status code between 200
and 599
for one day, for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Cache TTL by status code
- Status code or enter range:
200-599
- Select option: a day
How to migrate:
-
Create a cache rule to cache responses with status code between
200
and599
for one day for any hostname containingexample.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Edge TTL
- Use cache-control header if present, use default Cloudflare caching behavior if not
- Status code TTL:
- Scope: Range
- From: 200
- To: 599
- Duration: 1 day
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule setting a custom cache key for all query string parameters, for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Custom Cache Key
- Query String: All query string parameters
How to migrate:
-
Create a cache rule to set a custom cache key for all query string parameters, for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Query string: All query string parameters
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning off Cloudflare Apps (deprecated) for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Disable Apps
How to migrate:
-
Create a configuration rule to disable Cloudflare Apps (deprecated) for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Disable Apps
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
This Page Rules setting turned off Mirage, Polish, and Rocket Loader. You can still turn on or off relevant Cloudflare features one by one using Configuration Rules.
Context:
You configured a Page Rule with Disable Performance (deprecated) for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Disable Performance
How to replace:
-
Create a configuration rule to disable Mirage, Polish, and Rocket Loader for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Mirage: Off
- Polish: Off
- Rocket Loader: Off
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
This Page Rules setting turns off Email Obfuscation, Rate Limiting (previous version), Scrape Shield, URL (Zone) Lockdown, and WAF managed rules (previous version). You can still turn on or off relevant Cloudflare features one by one using Configuration Rules and WAF custom rules.
Context:
You configured a Page Rule with Disable Security (deprecated) for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Disable Security
This setting turned off a subset of Cloudflare security features: Email Obfuscation, Rate Limiting (previous version), Scrape Shield, URL (Zone) Lockdown, and WAF managed rules (previous version).
How to replace:
-
Create a configuration rule to turn off one or more security features:
- Email Obfuscation (part of Cloudflare Scrape Shield)
- Hotlink Protection (part of Cloudflare Scrape Shield)
-
If required, create a WAF exception to skip one or more rules of WAF managed rulesets for requests coming from IP addresses in an allowlist.
-
Turn off your existing Page Rule and validate the behavior of the rules you created.
-
If your tests succeed, delete the existing Page Rule.
Context:
You configured a Page Rule turning off Zaraz for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Disable Zaraz
How to migrate:
-
Create a configuration rule to turn off Zaraz for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Disable Zaraz
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule adjusting Edge Cache TTL for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Edge Cache TTL
- Enter Edge Cache TTL: a day
How to migrate:
-
Create a cache rule to adjust edge cache TTL for caching resources on Cloudflare edge to one day, for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Edge TTL
- Ignore cache-control header and use this TTL
- Input time-to-live (TTL): 1 day
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning off Email Obfuscation for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Email Obfuscation
- Value: Off
How to migrate:
-
Create a configuration rule to turn off Email Obfuscation for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Email Obfuscation
- Value: Off
- Setting: Email Obfuscation
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Example #1: Redirect www
to root domain
Context:
You configured a Page Rule permanently redirecting www.example.com
to example.com
on all URI paths:
- URL:
www.example.com/*
- Setting: Forwarding URL
- Select Status code: 301 - Permanent Redirect
- Destination URL:
https://example.com/$1
How to migrate:
-
Create a single redirect to permanently redirect requests from
https://www.example.com
tohttps://example.com
. You can select the Redirect from WWW to Root rule template or enter the following rule configuration:-
If incoming requests match: Wildcard pattern
- Request URL:
https://www.example.com/*
- Request URL:
-
Then:
- Target URL:
https://example.com/${1}
- Status code: 301
- Preserve query string: Enabled
- Target URL:
-
-
Turn off your existing Page Rule and validate the behavior of the redirect you created.
-
If your tests succeed, delete the existing Page Rule.
Notes about the rule equivalence
The provided example using Single Redirects is not an exact match for the previously existing Page Rule in the same example.
The exact equivalent would need to match both HTTP and HTTPS incoming requests, which you could achieve using a wildcard pattern like the following (notice the extra *
after http
):
- Request URL:
http*://www.example.com/*
This would require you to also change the Target URL to use the second wildcard capture group instead of the first one (corresponding to the text captured by second *
in the wildcard pattern above):
- Target URL:
https://example.com/${2}
Page Rules configuration | Migrate to a single redirect |
---|---|
Example #2: Redirect all pages under old path to new path
Context:
You configured a Page Rule permanently redirecting example.com/old-path
to example.com/new-path
:
- URL:
example.com/old-path/*
- Setting: Forwarding URL
- Select Status code: 301 - Permanent Redirect
- Destination URL:
https://example.com/new-path/$1
How to migrate:
-
Create a single redirect to permanently redirect requests for
example.com/old-path
toexample.com/new-path
:-
If incoming requests match: Wildcard pattern
- Request URL:
https://example.com/old-path/*
- Request URL:
-
Then:
- Target URL:
https://example.com/new-path/${1}
- Status code: 301
- Preserve query string: Enabled
- Target URL:
-
-
Turn off your existing Page Rule and validate the behavior of the redirect you created.
-
If your tests succeed, delete the existing Page Rule.
Notes about the rule equivalence
The provided example using Single Redirects is not an exact match for the previously existing Page Rule in the same example.
The exact equivalent would need to match both HTTP and HTTPS incoming requests, which you could achieve using a wildcard pattern like the following (notice the extra *
after http
):
- Request URL:
http*://example.com/old-path/*
This would require you to also change the Target URL to use the second wildcard capture group instead of the first one (corresponding to the text captured by second *
in the wildcard pattern above):
- Target URL:
https://example.com/new-path/${2}
Page Rules configuration | Migrate to a single redirect |
---|---|
Context:
You configured a Page Rule changing the Host
HTTP header to example.saas-provider.com
, for all requests addressed at any subdomain of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Host Header Override
- Enter value:
example.saas-provider.com
How to migrate:
-
Create an origin rule changing the
Host
header toexample.saas-provider.com
for any hostname containingexample.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Set origin parameters:
- Host Header > Rewrite to:
example.saas-provider.com
- Host Header > Rewrite to:
- Set origin parameters:
-
-
Turn off your existing Page Rule and validate the behavior of the origin rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to an origin rule |
---|---|
Context:
You configured a Page Rule adding a CF-IPCountry
HTTP header, for all requests addressed at any subdomain of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: IP Geolocation Header
- Value: On
How to migrate:
- Turn on the Add visitor location headers Managed Transform — a Transform Rules feature — to add the
CF-IPCountry
and other location headers to all requests. - Turn off your existing Page Rule and validate the behavior of the Managed Transform.
- If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a Managed Transform |
---|---|
Context:
You configured a Page Rule turning off Mirage for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Mirage
- Value: Off
How to migrate:
-
Create a configuration rule to turn off Mirage for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Mirage
- Value: Off
- Setting: Mirage
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule turning off Opportunistic Encryption for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Opportunistic Encryption
- Value: Off
How to migrate:
-
Create a configuration rule to turn off Opportunistic Encryption for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Opportunistic Encryption
- Value: Off
- Setting: Opportunistic Encryption
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule turning off Origin Cache Control for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Origin Cache Control
- Value: Off
How to migrate:
-
Create a cache rule to determine edge cache behavior for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Origin Cache Control
- Enable Origin Cache Control: Off
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning on Origin Error Page Pass-thru for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Origin Error Page Pass-thru
- Value: On
How to migrate:
-
Create a cache rule to determine edge cache behavior for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Origin error page pass-thru
- Use Origin error page pass-thru: On
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning off Polish for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Polish
- Value: Off
How to migrate:
-
Create a configuration rule to turn off Polish for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Polish
- Select value: Off
- Setting: Polish
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule turning on Query String Sort for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Query String Sort
- Value: On
How to migrate:
-
Create a cache rule to sort query string parameters for caching purposes, for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Cache key
- Sort query string: On
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule changing the origin to example.saas-provider.com
, for all requests addressed at any subdomain of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Resolve Override
- Enter value:
example.saas-provider.com
How to migrate:
-
Create an origin rule overriding the origin to
example.saas-provider.com
for any hostname containingexample.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- DNS Record > Override to:
example.saas-provider.com
- DNS Record > Override to:
-
-
Turn off your existing Page Rule and validate the behavior of the origin rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to an origin rule |
---|---|
Context:
You configured a Page Rule turning on byte-for-byte equivalency checks for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Respect Strong ETags
- Value: On
How to migrate:
-
Create a cache rule to respect strong ETags for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then:
- Cache eligibility: Eligible for cache
- Setting: Respect strong ETags
- Use strong ETag headers: On
-
-
Turn off your existing Page Rule and validate the behavior of the cache rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a cache rule |
---|---|
Context:
You configured a Page Rule turning off Rocket Loader for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Rocket Loader
- Value: Off
How to migrate:
-
Create a configuration rule to turn off Rocket Loader for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Rocket Loader
- Value: Off
- Setting: Rocket Loader
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule setting Security Level to I'm Under Attack for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: Security Level
- Select Security Level: I'm Under Attack
How to migrate:
-
Create a configuration rule to set Security Level to I'm Under Attack, for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: Security Level
- Select Security Level: I'm Under Attack
- Setting: Security Level
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
Context:
You configured a Page Rule adding a True-Client-IP
HTTP header for all requests addressed at any subdomain of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: True Client IP Header
- Value: On
How to migrate:
- Turn on the Add "True-Client-IP" header Managed Transform — a Transform Rules feature — to add the
True-Client-IP
header to all requests. - Turn off your existing Page Rule and validate the behavior of the Managed Transform.
- If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a Managed Transform |
---|---|
Context:
You configured a Page Rule setting SSL to Strict for all subdomains of example.com
and the example.com
domain itself:
- URL:
*example.com/*
- Setting: SSL
- Select SSL/TLS encryption mode: Strict
How to migrate:
-
Create a configuration rule to set SSL to Strict, for any hostname containing
example.com
:-
When incoming requests match: Custom filter expression
- Using the Expression Builder:
Hostname contains "example.com"
- Using the Expression Editor:
(http.host contains "example.com")
- Using the Expression Builder:
-
Then the settings are:
- Setting: SSL
- Select SSL/TLS encryption mode: Strict
- Setting: SSL
-
-
Turn off your existing Page Rule and validate the behavior of the configuration rule you created.
-
If your tests succeed, delete the existing Page Rule.
Page Rules configuration | Migrate to a configuration rule |
---|---|
The following Page Rules settings will not be migrated to other types of rules:
- Disable Performance (this setting is deprecated)
- Disable Railgun (this setting is deprecated, since Railgun is no longer available)
- Disable Security (this setting is deprecated)
- Response Buffering (this setting is deprecated)
- Web Application Firewall (this setting is deprecated, since the previous version of WAF managed rules is deprecated)
All other Page Rules settings will be migrated during 2025.
If you have feedback to share, refer to our Community thread ↗.