Open an account with Cloudflare – the free plan
https://www.cloudflare.com/a/login
Add domain name
Note you have to change name servers to cloud name servers
Click on DNS
In the NAME add sub domain names example demo.
In the IVp 4 add the IP address – copy paste
Add record.
CRYPTO select flexible
In wordpress add plugin
SSL Insecure Content Fixer
tick in capture
Tick = HTTP_X_FORWARDED_PROTO (e.g. load balancer, reverse proxy, NginX)
Save changes
Make sure you the text below in the htaccess
# BEGIN WordPress
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Allow 24/48 hours to propergate