SSL Certificates (HTTPS)

Migrate WordPress to HTTPS with Cloudflare Flexible SSL

Google announced that HTTPS as a ranking signal and will affect a search result. This is a great advantage to take this opportunity to migrate to HTTPS protocol. Furthermore, Cloudflare, offer FREE SSL for all websites that is using their services even FREE account.

To take this opportunity, I migrate this WordPress blog to HTTPS protocol by utilizing Flexible SSL. With flexible SSL I don’t have to spend any extra money to by SSL certificates or even install any self signed SSL certificate on my hosting account.

Migrating to HTTPS by using Cloudflare Flexible SSL is very easy & can be done by following the steps below.

1. Login to your Cloudflare account, select your domain and select Crypto. In SSL, make sure that you have an active certificate and select Flexible SSL.

2. Configuring WordPress for SSL/HTTPS. In WordPress dashboard browse to Settings -> General

3. Change the following from

WordPress Address (URL)	http://www.internetearnings.com
Site Address (URL)	http://www.internetearnings.com

to

WordPress Address (URL)	https://www.internetearnings.com
Site Address (URL)	https://www.internetearnings.com

4. Set up a 301 permanent redirect from HTTP to HTPPS. Best to do via Cloudflare Page Rules. To do this, in Cloudflare select your domain and select Page Rules.

5. In “Add new rule“, turn “ON” forwarding.

6. In “Forwarding type” select “Permanent – 301“.

7. In “URL Pattern” field key in “http://www.internetearnings.com/*“. Make sure “*” is there.

8. In “Destination URL” field key in “https://www.internetearnings.com/$1

9. Browse to your website to make sure everything is good.

10. If you have SSL error, the best is to use Google Chrome Developer tools to identify which web resources are not loading through HTTPS & fix it.

How to enable SSL connection in OpenCart

Recently, Cloudflare enable FREE SSL Certificates to all the their users. As a long Cloudflare user, I quickly enable it to my OpenCart site. There are 2 levels of SSL in OpenCart. They are

  1. Minimum SSL – Only enable during checkout.
  2. Full SSL – SSL on entire site.

Below are the guides on how to enable both level.

Step 1 – Required for both Minimum SSL and Full SSL

This step involve enabling SSL in the OpenCart Dashboard

Log into the OpenCart Dashboard and browse to

System → Settings → Click Edit Store → Click Server tab → In “Use SSL” Check “YES” in the radio button → Click “Save” Button

Step 2- Only for Minimum SSL

This step involve enabling SSL in the “config.php” file. There are 2 files need to be edited.

1. /config.php

Find this code

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

2. /admin/config.php

Find this code

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/admin/');
define('HTTPS_CATALOG', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/admin/');
define('HTTPS_CATALOG', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

 

Step 3- Only for Full SSL

This step involve enabling SSL in the “config.php” file. There are 2 files need to be edited.

1. /config.php

Find this code

// HTTP
define('HTTP_SERVER', 'http://www.example.com/');
define('HTTP_IMAGE', 'http://www.example.com/image/');
define('HTTP_ADMIN', 'http://www.example.com/admin/');

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTP
define('HTTP_SERVER', 'https://www.example.com/');
define('HTTP_IMAGE', 'https://www.example.com/image/');
define('HTTP_ADMIN', 'https://www.example.com/admin/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

2. /admin/config.php

Find this code

// HTTP
define('HTTP_SERVER', 'http://www.example.com/admin/');
define('HTTP_CATALOG', 'http://www.example.com/');
define('HTTP_IMAGE', 'http://www.example.com/image/');

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/admin/');
define('HTTPS_CATALOG', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTP
define('HTTP_SERVER', 'https://www.example.com/admin/');
define('HTTP_CATALOG', 'https://www.example.com/');
define('HTTP_IMAGE', 'https://www.example.com/image/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/admin/');
define('HTTPS_CATALOG', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

 

Step 4- Only if you use Cloudflare Flexible SSL

For your domain, select CloudFlare settings domain, browse down until you see “SSL” option. From there select Flexible SSL.

You site should be running on SSL from now on.