Search This Blog

Monday, September 17, 2018

How to exclude a specific URL from CloudFlare's page rule

The first step to using Page Rules is to define a pattern that defines when the rule is triggered. These patterns can be simple, such as a single URL, or complicated including multiple wildcards. Imagine you have a content management system with a single administrative URL:

If you want CloudFlare's performance and caching options off for this URL, then you would turn off the options using the drop down menus or toggles for the various CloudFlare features.

Wildcard and Advanced Pattern Matching

The pattern above will only match the following URL:

It will not match any of the following URLs:  [http ≠ https]  [missing www subdomain]  [admin ≠ admin.php]

You can make rules more flexible by including wildcards with the * character. For example, if you wanted the pattern to match all four of the above URLs, you could use a pattern like:


A wildcard can represent zero or more characters and can be used anywhere in the pattern. So, for example, the following pattern:*b*/*

Would match:

But would not match:  [missing the trailing slash]  [sam doesn't contain a "b"]
Please note: Page Rules are applied in the order that they are listed. If you want to change the position of a Page Rule, you can drag it up or down using the icon on the left hand side.