I wanted to install an SSL certificate for my personal website.
After reading some recommends, I registered on Cloudflare, add my website, and activate the free scheme.
Make it flexible to use http or https when visiting the website.
I tried http and https URLs, both addresses work for the single blog article page.
Can’t Login wp-admin Due To Https Redirect
Then I changed site address and WordPress address, made them start with
https like this.
The bad response showed in my browser, I can’t log in WordPress panel anymore.
The fear I can’t manage my site became stronger in my heart as the time pass.
I believe Cloudflare did its job without mistake.
That must be my fault, I set a few options wrongly for my wp-admin.
I got some cue on StackOverflow, and checked my database.
The relevant commands are in the following section.
mysql -u root -p
SELECT * FROM wp_options WHERE option_name='siteurl' OR option_name='home';
Maybe the transform from http to https is too early, or I miss something on the panel.
Anyway, I reset it to HTTP and tried again. Everything is fine.
update wp_options set option_value = 'https://www.weiy.city' where option_name = 'home';
update wp_options set option_value = 'https://www.weiy.city' where option_name = 'siteurl';
Install SSL Certificate
Cloudflare supports generating certificate, we can copy it and upload to server.
We would get private key and certificate file (pem).
Save all data and put both files in the website root directory, such as
# ls weiy.city*
The rest jobs are easy to be done if we install the plugin Really Simple SSL.
It will help us to check our SSL certificate and configure our website for https transform.