CloudFlare + WordPress admin, Cache issue
By:Roy.LiuLast updated:2019-08-17
Below is my website environment :
- WordPress 3.8.1
- CloudFlare Pro Plan
1. Problem
I’m unable to login WordPress after changing my custom DNS to CloudFlare, below is the error message :
ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress
P.S The browser’s cookies are enabled.
Here’s the CloudFlare’s page rule
Custom caching : Cache everything
*.example.com/*
2. Solution – Pro Plan
To solve it, disable the caching for WordPress admin, login and preview pages. Create three more CloudFlare page rules like this :
Custom caching : Bypass cache
*.example.com/wp-admin/* *.example.com/wp-login.php* *.example.com/*&preview=true
And turn off all the CloudFlare features like : Rocket Loader, performance, always online, cache and etc, you don’t need CloudFlare to handle your WordPress admin functions.
In summary, there are total four page rules :
*.example.com/wp-admin/* //disabled everything *.example.com/wp-login.php* //disabled everything *.example.com/*&preview=true //disabled everything *.example.com/* //enabled any features you want
3. Solution – Free Plan
For CloudFlare free plan, there is only one page rule, try define the following page rule pattern :
*.example.com/wp-*
Note
I’m using CloudFlare’s pro plan, unable to test in a free plan environment, let me know if the above page rule is working.
I’m using CloudFlare’s pro plan, unable to test in a free plan environment, let me know if the above page rule is working.
References
From:一号门
COMMENTS