Recently while working on a WordPress site for a client I came across a redirect loop when working with Cloudflares Flexible SSL. Upon activating the Flexible SSL on the WordPress install, I received a redirect loop on every screen of the site. This meant I could no longer access the admin or the front-end of the site.
Looking around Cloudflare’s online help I was able to quickly locate a solution. Cloudflare have a great article outlining the problem, and also a post outlining the fix.
In the past, I’ve never normally used the Cloudflare plugin within WordPress sites, this has been due to on-going maintenance of WordPress. As I have found in the past, the more plugins installed in a WordPress setup the more on-going maintenance costs clients. We always try to keep costs down as best we can, to ensure the most strategic value for money and the most efficiency for on-going management of WordPress setups. It is also worth keeping in mind every time a plugin is introduced into a WordPress ecosystem it adds another level of complexity and potential risk, but that is another story!
To outlined the fix
- Install the office WordPress Cloudflare plugin, when setting up Cloudflare for a site. In the past I have always done this manually using Cloudflare and DNS records.
- Ensure the plugin is the most up to date as well as your WordPress version.
- Add a new page rule for your domain that redirects all traffic to HTTPS.
- Information on how to setup pages rules is found on the Cloudflare support forum.
These two fixes should resolve the bug. However as outlined in the Cloudflare article, if you are still receiving the redirect bug once implemented it is most likely the issue is being caused by another plugin you have active on your installation. If that is the case there are a few options.
Other Options
- De-active the other active plugins one at a time to try and locate the plugin causing the issue.
- Once found, if the plugin is not mission critical we’d recommend deactivating and trying to locate an alternative. As in most cases with WordPress plugins there are a number of other options.
- Assess whether it is worth upgrading from Flexible to another SSL product. Often hosting companies offer free SSL certificates appropriate for use on sites not taking online transactions. We’ve had a lot of experience with Let’s Encrypt a great and free product.
So a few steps and potential options in resolving this WordPress and Cloudflare Flexible SSL redirect loop issue. Hopefully this fix is a quick one for you! Good luck.