Page rule syntax


#1

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 www.domain.com or http://www.domain.com to https://domain.com.

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:

.paulraphaelson.com/
Forwarding URL 301 permanent redirect
https://paulraphaelson.com/$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:

*paulraphaelson.com/
Cache Level: Cache Everything

Any feedback on this?


#2

That first rule should be *www.paulraphaelson.com/* 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.