There is an easy solution for the SSL issues you’re having after enabling Cloudflare SSL.
After enabling Cloudflare SSL on your site, You might get some issues like,
- Site not secure or Invalid SSL Warnings
- Your WordPress site going into Endless Redirect Loop
- WordPress wp-admin going into Redirect Loop
Or any similar issue or errors. They are all caused by enabling Cloudflare SSL.
You must have tried to find a solution using Google, but most of the websites and forums are providing solutions that simply don’t work.
I was in the same situation as you are, Stumbling through countless sites and forums trying to find a fix so my website can open.
I also contacted my hosting provider but they asked me to wait 24 hours. But I knew there was some issue, And even after 24 hours, the issue was there.
In some cases, the solution is simply to change SSL status from Full to Flexible on Cloudflare. But that doesn’t solve the issue for most.
But for some reason, anyone you ask for help will ask you to make sure that it’s set to Flexible, Even though it’s already set to Flexible. That makes you frustrated on finding the cause behind this.
But do not worry, we have an easy fix for the WordPress redirect loop on Cloudflare SSL or any other Cloudflare SSL related issue you’re getting.
Now without wasting any more of your time,
Here is the fix that will resolve the Cloudflare SSL issue you’re having:
First, Edit wp-config.php file from your WordPress root through Cpanel or FTP (whichever is your preferred method for editing files).
Now in wp-config.php, Locate this line:
/* That’s all, stop editing! Happy blogging. */
Now before this line, Add the following line:
$_SERVER['HTTPS'] = 'on';
And save the wp-config.php file.
For example, This is what my wp-config.php file looks like:
Now go ahead and try to load your site again. In most cases, it should load normally without any issues.
This solution should fix the Cloudflare Redirect Loop issue instantly.
But if you still have any issues, you can comment below and we’ll try to help you further.