Deprecated - Using Wildcards in Page Rules

This tutorial is deprecated in favour of Understanding and configuring Cloudflare Page Rules (Page Rules Tutorial) · Cloudflare Support docs


The basic page rule

If we have a page rule set to match:

It will match both and You do not need to specify http:// or https:// to match in the page rule, unless you want to limit it to only trigger on that protocol. You do not need a wildcard (*) to match both http and https.


In page rules, the asterisk (*) can be used as a wildcard, for instance, if we have a page rule set to match:*z

It will match and, the asterisk means it will match any subdirectory beginning with a and ending with z

Wildcard examples* would match


but NOT a subdomain of like .

Adding another wildcard before, such as:
would match anything before the as well, for example it would match and also

Adding a dot after the first wildcard, such as:
would match anything before the , but not itself. It would match , but NOT

Use with ‘Forwarding URL’

The page rule wildcards can be useful to match a section of your website or those of a certain file type, however it can also be useful when redirecting using the ‘Forwarding URL’ setting. It can then be used alongside the $ symbol in the URL to forward to.

For example, if you set:*
Forwarding URL$1

This would match any path on and redirect it to the same path on E.g. would redirect to

You can use $1, $2, $3 etc. to match any *.

You can read more in the tutorial, Deprecated - Using page rules to perform redirects.

Note that an ‘Orange Clouded’ DNS record is required for a page rule to run

For example:
If I wanted a page rule to match, then I would need to add a DNS record for subdomain and set it to :orange:.

Relevant support article:

Tutorial Reference: CT-30

Reviewed: 08/21

This is a Community Tutorial, most are wiki posts, so can be contributed to by Regulars and MVPs here. If there is a tutorial you would like to see, you can request one here.

If you would like to provide any feedback on this tutorial, please post in the #Meta category, tag your post #TutorialFeedback and let us know the Tutorial Reference above.

Other great resources on this community include the Community Tips . These address best practices when configuring Cloudflare, how to fix issues you may see, and tools to troubleshoot. Also you can view Expert Tips, great posts on the community from people in the know that may help you with your issue.

We encourage users to check out these great resources and the Cloudflare Support Centre before posting