Update Page Rules migration guide with more information #14737
Labels
content:edit
Request for content edits
documentation
Documentation edits
product:rules
Related to rules
Existing documentation URL(s)
https://developers.cloudflare.com/rules/reference/page-rules-migration/
What changes are you suggesting?
Currently this guide is missing information on the following examples. Many of these are where people struggle during migration and need extra care and attention:
Matching paths
Matching paths is much more complex with other Rules products compared to Page Rules. For example:
Page Rule:
https://jross.dev/test/*/*.zip
Equivalent Ruleset Engine:
http.host eq "jross.dev" and lower(http.request.uri.path) matches "^/test/[^/]+/.*\.zip$
(or something more complex without regex)
The migration guide doesn't really go into matching paths at all and ideally should be extended to showcase some examples here.
Regex
Regex is required for a lot of rules to match more complex paths, especially compared to wildcards previously.
Regex is also only available on paid plans though, so some functionality that was possible on free plans is not possible with other Rules products today, and this need to be described.
Case Sensitivity
Page Rules were case insensitive (in matching). Other Rules products are case sensitive, and to match the same behaviour, you need to wrap any functions in
lower()
or similar before doing checks.This difference should probably be mentioned so people don't hit any obscure edge-cases when migrating their rules.
Wildcards
I have a thread on the forum that details this more: https://community.cloudflare.com/t/page-rules-are-now-deprecated-without-good-replacements/656245?u=cherryjimbo
But essentially recreating a Page Rules redirect with
www.jross.dev/*/downloads/*/*.txt
anddownloads-$2.jross.dev/texts/$1/$3.txt
, ends up looking something like this:This is much more complex, and as far as I can tell, impossible today on plans that do not have access to Regex - wildcard support is coming, but isn't available to folks yet.
Additional information
No response
The text was updated successfully, but these errors were encountered: