Page Rules, regular expressions allowed?

*domain.tld/wp-[login|admin]

Is the use of piping and brackets for regular expression syntax allowed in Page Rules?

I’d like the above rule to apply on the wp-admin folder.
I’d like the above rule to apply on the wp-login.php page.

Would the above Page Rule work correctly?

Yes, round brackets instead of square brackets!

I was hoping to kill two birds with one Page Rule.
I wanted that Page Rule for; Security Level: High, Cache Level: Bypass

I thought of *domain.tld/wp-* but that would affect core Wordpress files (wp-content, wp-includes)

Actually, for what you intend, the solution proposed by @sandro covering /wp-* should work just fine. You don’t actually need to have a “Cache Level: Bypass” setting on that rule. To be effective, this page rule must be placed before the “Cache Level: Cache Everything” page rule, which won’t ever trigger for the areas covered by /wp-*.

So you could have:

PR1

URL: /wp-*
Security Level: High
Disable Apps
Rocket Loader: OFF
etc

PR2

URL: /*
Cache Level: Cache Everything

The first rule will trigger for anything under /wp-*, which of course includes /wp-content/*, but since it isn’t setting a cache level for the path, the default caching policy will apply: static files such as image, JS and CSS files will be cached, HTML won’t.

And because of the way Rocket Loader works, the first page rule won’t prevent it from working on the JS files invoked by the HTML covered by the Cache Everything page rule, even though these files will probably be under /wp-content/*.

Make sure you hit Purge Everything and wait a bit after you set the rules as proposed, to purge any already cached assets that shouldn’t have been cached.

I will use these Page Rules.
Thanks for explaining how they’ll work.

1 Like

ok then