Page Rule for any 4 digit number after URL

Hi :slight_smile:

I need a page rule that will apply to any URL containing 4 digits and a β€˜-’

so like this for example

I tried:****-*$1$2$3$4-*^\d{4}*[0-9][0-9][0-9][0-9]*

ha ha no luck :(. can it be done?


I also tried this, no good*-

I don’t believe Page Rules accept a regular expression, only wildcard *.

Transform Rules on the other hand do accept regular expressions.



The rule I want to create is Cache Everything, so I guess it’s impossible.

Not really. Cache Rules (beta) can also use regex match (but only for Business or Enterprise Plan).

URI Path matches regex "^/[0-9]{4}-"

If you are on a Pro or Free Plan, and assuming all URLs on your site that begin with a number are those with a 4-digit number, you can try using instead a long list of combinations:

URI Path starts with "/0"
URI Path starts with "/1"
URI Path starts with "/9"

Eligible for Cache…


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.