Can I use regex in PageRules?


first of all, I searched for this with “PageRule with regex” but only got 4 unrelated results.

I wonder if I can use regex in the PageRule.

I have a multilanguage website, if no locale is given in the URL, my application figures out the language from the browser and redirects.


German guy requesting gets redirected to
English guy requesting gets redirected to
and so on.

In short, I want to cache all pages that include a language in their URI.

I wonder if a pagerule like


is possible. Or would I need to set 6 Page rules (one for each language) for this?


Test Before You Post
Unsure of the issue? Test before posting using the Cloudflare Diagnostic Center: Diagnostic Center | Check SSL and Test Website Security | Cloudflare

In short, you can’t - only wildcards allowed.

1 Like

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