Set up Cloudflare SSL if origin server doesn't support SSL


I have bought a Cpanel Shared Hosting that doesn’t have any SSL support nor any option to add custom SSL. So I need to use Cloudflare SSL.
I have enabled the following.

  1. Cloudflare Flexible SSL.
  2. Always Use HTTPS.
  3. Opportunistic Encryption
  4. Automatic HTTPS Rewrites.

Now Do I need to write htaccess rule for redirecting http to https?
and do I need to change http to https from Setting > General> Wordpress Address/Site Address ?

Please mention if I have missed anything.


Step 1. Add this code in the wp-config.php

define('FORCE_SSL_ADMIN', true);
// in some setups HTTP_X_FORWARDED_PROTO might contain 
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)

Source & More information

  1. Install, Activate Really Simple SSL

  2. Go to settings enable it

Rest you are good to go


I have added the line in the beginning of wp-config.php. No problem so far. Thanks.