Page rule syntax

I’m not sure I understand how the wildcard syntax works.

It’s hard for me know if my rules are working, because there’s no simple check. My first rule is to convert or to

I’m doing this in part because I read that Cloudflare will do the redirect more quickly than a server-based .htaccess redirect. And partly because the “Always use HTTPS” function (which I use) doesn’t seem to force sites to use https.

Here’s my rule:
Forwarding URL 301 permanent redirect$2/

This is based on syntax I found in the documentation. Does it look correct? The site redirects as expected, but I don’t know how to check if the redirect is happening in Cloudflare or at my server. I especially don’t understand the /$2/ variable. Why 2? I tried with $1 and it broke the site.

My second rule is to get Cloudflare to cache everything on the landing page. I don’t know how to check if this is working, or if there’s a better way to write it:

Cache Level: Cache Everything

Any feedback on this?

That first rule should be ** to catch any www

To see if your landing page is being cached, use Dev Tools in Firefox or Chrome and use the network tab to see your site assets. Click on one to look at the headers, and you should see a cf-cache-status: HIT/MISS/etc.

1 Like