{"id":1028,"date":"2016-04-12T16:33:13","date_gmt":"2016-04-12T06:33:13","guid":{"rendered":"http:\/\/benryan.com.au\/?p=1028"},"modified":"2017-08-12T08:12:08","modified_gmt":"2017-08-11T22:12:08","slug":"use-jetpack-cloudflare-wordpress-site","status":"publish","type":"post","link":"https:\/\/benryan.com.au\/use-jetpack-cloudflare-wordpress-site\/","title":{"rendered":"How to use Jetpack and CloudFlare on a WordPress site"},"content":{"rendered":"
I have recently moved my hosting across to Dreamhost on their DreamPress 2 package<\/a> with CloudFlare<\/a>. First impressions… brilliant. Easy to use, quality built, and best of all, it’s fast. The server response dropped from 1.3 seconds down to 200 milliseconds. The only downfall (if you can even call it that) was the use of Jetpack and CloudFlare on a WordPress site.<\/p>\n I had connection errors, statistic problems, and Jetpack’s publicise plugin would connect to my social networks. I knew there must have been a way to use Jetpack and CloudFlare on a WordPress site, I just needed to find what it was. Below is the answer:<\/p>\n This is a few steps to follow to configure CloudFlare on your site, before installing the Jetpack plugin<\/em><\/p>\n We will be doing the following:<\/p>\n This PageRule is to ensure CloudFlare ignores your site’s dashboard. As previously mentioned, it is known to cause issues with Jetpack and CloudFlare on a WordPress site. Thankfully, it isn’t really required for your WordPress dashboard.<\/p>\n 1.<\/strong> In your CloudFlare dashboard, go to the PageRules section. 4.<\/strong> Save your changes.<\/p>\n 1.<\/strong> Under the Crypto menu, enable on of CloudFlare’s SSL options.<\/p>\n <\/p>\n 2.<\/strong> Wait for changes to take affect, approximately between 20 minutes and 4 hours. 6.<\/strong> In the WordPress admin, under Setting > General, change both your site address and WordPress address to use HTTPS. 1.<\/strong> In your CloudFlare dashboard, go to the PageRules section. <\/p>\n 4.<\/strong> Wait for changes to take affect, approximately between 20 minutes.<\/p>\n And thats it. Should be all done and good to use Jetpack and CloudFlare on a WordPress site.<\/p>\nUse Jetpack and CloudFlare on a WordPress site<\/span><\/h2>\n
\n
Create a PageRule to exclude the WordPress dashboard from CloudFlare<\/span><\/h3>\n
\n2.<\/strong> In the “Add New Rule” section, enter the following: *yoursite.com\/wp-admin*<\/em>
\n3.<\/strong> Select the following options:<\/p>\n\n
Setting up CloudFlare’s SSL certificate on your site<\/span><\/h3>\n
\n3.<\/strong> Install and activate the CloudFlare Plugin<\/a>
\n4.<\/strong> To avoid running into a loop, install the CloudFlare Flexible SSL Plugin<\/a>
\n5.<\/strong> Enable administration over SSL<\/a> by adding the following code to wp-config.php<\/p>\n
\n\r\n\/** Admin over SSL *\/\r\ndefine('FORCE_SSL_ADMIN', true);\r\n\r\n\/** Set port to 443 *\/\r\n$_SERVER['SERVER_PORT'] = 443;\r\n<\/pre>\n
\n
\n7.<\/strong> Wait for changes to take affect, approximately between 20 minutes.<\/p>\nRedirect all visitors to HTTPS\/SSL with CloudFlare<\/span><\/h3>\n
\n2.<\/strong> In the “Add New Rule” section, enter the following: http:\/\/*yoursite.com*<\/em>
\n3.<\/strong> Set “Always use HTTPS” to on.<\/p>\n