[IMPORTANT] Page Rules Migration

Hi Cloudflare Community!

We’re reaching out to inform you that Page Rules are now considered a legacy product.

Cloudflare recommends considering our new Rules features for your new implementations. We encourage you to follow the recommendations in this migration guide to learn about the new Rules products and how you can start adopting them today.

ACTION: Please review our migration guide and consider transitioning to our new Rules products for your new implementations.

In 2022, we announced in our blog “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 — Cache Rules, Configuration Rules, Compression Rules, Origin Rules, Redirects and Transform Rules — are now generally available and have already been adopted by tens of thousands of Cloudflare customers.

Why Transition from Legacy Page Rules?

Legacy Page Rules had several fundamental limitations, triggering solely based on URL patterns and being capped at 125 per zone to avoid performance issues. Debugging was also complex when multiple legacy Page Rules were applied to a single request.

What’s Different with New Rules?

Our new Rules, powered by the Ruleset Engine, offer versatile configuration with a robust language supporting various parameters like HTTP request headers and body, as well as response fields.

Scalability has significantly improved, with increased quotas for all plans: Enterprises now enjoy up to 760 Cloudflare Rules combined per zone, Business plan zones go from 50 to 310 rules per zone, Pro from 20 to 155 and Free from 3 to 65.

Execution is predictable as each rule operates independently, simplifying troubleshooting. The Trace feature helps understand rule interactions.

New Rules also ensure consistency, with common fields and capabilities shared across products, offering a seamless experience and predictable Terraform configurations.

Migration

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 familiarise 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. Our 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.

For more information on the transition, please refer to our migration guide.

Note: This post has been updated on June 10th, 2024 to reflect our revised migration plan. In this update, we are making it clear that Cloudflare will handle the migration of existing Page Rules, so customers do not need to migrate their own rules unless they wish to do so. Additionally, Page Rules will remain available for all accounts and zones, including new ones, until the start of the migration.

10 Likes

Hi there,

When will the Cloudflare API (Cloudflare API Documentation) be updated to create those new Redirect Rules?
We currently use Page Rules (important: this product is deprecated, read more here https://developers.cloudflare.com/rules/reference/page-rules-migration/) (via the CF API) to create simple redirects. I can’t see any information in the API docs on how to create Redirect Rules.

Cheers

Redirect Rules use the rulesets engine, see here…

We are also working on migration guide for API and Terraform users, aiming to have this information present directly on the developer documentation in a few weeks.

2 Likes

Hello there. In the instructions provided in the link, specifically in the section Page Rules migration guide · Cloudflare Rules docs, it is stated that the settings listed there will be migrated to the new Rules. In particular, it mentions Always Use HTTPS, Automatic HTTPS Rewrites, and SSL (SSL/TLS encryption mode, if I understood correctly). These settings are not explicitly categorized under Page Rules (important: this product is deprecated, read more here https://developers.cloudflare.com/rules/reference/page-rules-migration/) in the admin panel. Will they also undergo migration? Will their current API functionality eventually cease to work, requiring the use of new functionality to manage them?

1 Like

@multitool.testdev, so Always Use HTTPS, Automatic HTTPS Rewrites, and SSL mode are all standalone zone-level settings located under the SSL tab, but Page Rules allow to control these on specific URLs as opposed to your entire zone.

If you have a Page Rule that, for example, enables automatic HTTPS rewrites or changes SSL mode for a specific subdomain, we advise you to proactively migrate these to Configuration Rules.

When it comes to Always Use HTTPS, we currently recommend Dynamic Redirects, however we have a simpler and more straightforward solution coming later this year that will allow users to deploy a configuration like this in one click.

To confirm, standalone zone-level settings that you can find under SSL tab or elsewhere in the dashboard (apart from the Rules tab itself) are not subject to any changes during this deprecation, and we will not perform any migration or changes on your behalf without prior notification.

3 Likes

Hey there, the documentation was helpful, especially the visual guides. Thank you for those!

Here are some questions:

  1. How can we exclude subdomains? The documentation mainly focuses on one use case, like example.com, but we need more flexibility. We reached out to support, but they couldn’t confirm whether (http.host eq "example.com") will only affect the main domain or also impact subdomains when using “Migrate Cache Level (Cache Everything)”.

Alternatively, would this rule work: (http.host eq "example.com") || (http.host eq "www.example.com")?

  1. In the “Migrate Bypass Cache on Cookie” visual guide, is it necessary to include “hostname contains,” or can the rule work without it?

  2. A note to warn that not all plans include all operators would also be helpful. We encountered an error on some Free accounts: “not entitled: the use of operator Matches is not allowed; a Business plan or a WAF Advanced plan is required.” It’s worth mentioning that this error occurred when trying to add a Caching → Cache Rule, not a WAF rule. Or WAF Advanced plans include more operators including for Cache Rules?

It’s a strict match. If it was “contains”, then it would affect subdomains also.

It can work without it. It’ll just apply to all hostnames in the zone.

1 Like

Hello again, there is a phrase in your guide :
“For new Cloudflare accounts and zones, PageRules will be disabled starting July 1st, 2024.”
Do I understand correctly that for new zones that I create after July 1st on already existing accounts, PageRules will be unavailable? Only on accounts and zones existing before this date will I be able to continue using them?

Also, an API question - is any update planned for Cloudflare SDK (GitHub - cloudflare/cloudflare-php: PHP library for the Cloudflare v4 API) in connection with the new changes?

1 Like

Correct. We are aiming to disable Page Rules for new zones (and subsequently new accounts) first, ensuring that new users are adopting modern technology instead of a legacy one. At the same time, we are committed to providing wildcard support before making any changes to Page Rules for existing zones.

Not at the moment, as our priorities are UI, API and Terraform. From what I can see, I don’t believe PHP binding is actively supported anyway, and in the future all our SDKs should definitely be auto-generated: Lessons from building an automated SDK pipeline.

2 Likes

It would help a lot if you documented how to migrate Terraform recipes also.

Terraform migration guide as well as API are all coming in the next few weeks. :wink:

3 Likes

Hi
Most of the migrations state that once the migration part is done:

  • Turn off your existing Page Rule and validate the behavior of the Managed Transform.
  • If your tests succeed, delete the existing Page Rule.

However, what happens if youy have more than 1 action in your page rule eg Header Overwrite and Cache modifications?

If (for example) the Origin rule is created which “migrates” the Header overwrite do we have to then modify the existing Page rule to no longer have Host Rewrite BUT still have cache until the cache part is migrated?

What happens if the Page Rule is not turned off (for same page rule with Header overwrite and caching where header overwrite is migrated BUT not yet cache) does this mean the Header would just be overwritten twice and would not be validating. ?

Which is ran first between Rules versus Page Rules?

Thanks

New Rules take precedence over Page Rules: Redirects · Cloudflare Rules docs. So if you have contradicting changes between legacy and modern rules, modern rule will win over the legacy one, but both will get executed.

2 Likes

Just a heads up that the original post has been updated with our revised migration plan.

In this update, we are making it clear that Cloudflare will handle the migration of existing Page Rules, so customers do not need to migrate their own rules unless they wish to do so. Additionally, Page Rules will remain available for all accounts and zones, including new ones, until the start of the migration.

We have also added more examples on how to convert Page Rules URLs to Rules filter expressions and how to implement URL Forwarding using Redirect Rules to the migration guide for users that want to start using modern Rules products for their new implementations today.

5 Likes

Hello,

  1. Following the migration of some websites away from existing Page Rules, should we proceed with deleting the old Page Rules that were temporarily deactivated? Specifically to prevent any unexpected issues during the automatic migration next year. Could you confirm if disabled Page Rules will be migrated? And after the migration the Rules will remain disabled?

  2. Are there any plans to add a bulk import feature for Cache Rules (including WAF rules) within the dashboard, without requiring the use of an API? I noticed a similar question was addressed here: Can you export / import firewall rules?. Since many of these rules are repetitive, except for domain name changes, this feature would greatly streamline our workflow when working on multiple websites.

If you have confirmed that the behaviour is the same and you are confident you will no longer need these Page Rules, then it should be safe to delete them, however it is not required.

I will share more details about the migration in this thread as they become available. Our goal is to make this as seamless for users as possible whilst ensuring the exact same outcome for each rule.

This is not in active development on our end, so I would recommend Terraform.

Alternatively, if your rules do not vary between domains, you could route all your domains to one Cloudflare for SaaS zone and manage them centrally from there.

2 Likes

I noticed the mention of the migration guide for API and Terraform users. Is this guide already completed and available in the developer documentation? Could you provide a link?

API and Terraform guides have been deprioritised for now while we’re focusing on other high priority improvements.

However, the Terraform documentation itself is pretty self explanatory, so taking the existing feature correspondence table and cross-referencing it with the cloudflare_ruleset resource shouldn’t be a heavy lift for customers experienced in Terraform.

1 Like

The Page Rule deprecation notice is gone. Is it getting revived?