Cannot Login on Wordpress After installing Cloudflare SSL - Solution

I assume that some of the members of the Cloudflare community are still having a problem when installing Cloudflare SSL. The general issue we encounter is we cannot log in with WordPress or it won’t respond.

The simplest way that I found how to fix it is to insert the code below on wp-config.php

if (_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') _SERVER[‘HTTPS’]=‘on’;

this should be installed above:/* That’s all, stop editing! Happy blogging. */

I hope this will help your issues regarding this matter.

2 Likes

There are several ways to fix this.
I don’t use WP anymore, but I changed the page links in the WP database. I don’t remember the table but it worked as well.

Does that change all of the WP site’s internal links?

Not at all. It has no effect on your current website. It’s like that code will indicate on wp that your site is now SSL certified.

So you don’t have to change the website setting in the wp admin? What a headache saver!

No need, just to input the code as per instructed…

Hi. I am getting the following error after paste the code above in config.php

Parse error : syntax error, unexpected ‘=’ in /home/vacationincostar/public_html/wp-config.php on line 93

Check the string on line 93 on your server for typos. This is a PHP error.

https://codex.wordpress.org/Administration_Over_SSL

I’d generally strongly advise against such hacks. This is solely a configuration issue and should not be “fixed” by manually editing code and inserting random lines.

Just for the record, the quoted PHP code is not even valid.

1 Like

Correct. The codex link above has something similar. Tho, my issue is not to force redirecting is that my admin is be redirected to a 404 when I force it to use HTTPS. Here is a topic I opened if you can help me.

It has no effect on your current website. It’s like that code will indicate on wp that your site is now SSL certified.

1 Like