How to configure OpenCart to work with CloudFlare and SSL

The free account with CloudFlare does not support SSL. However, this does not mean you cannot use a free CloudFlare account with your SSL certificate. More information about this can be found in our tutorial here:

Does CloudFlare support SSL?

As you may or may not know, CloudFlare works via a CNAME record for www. This means thatwww.yourdomain.com is redirected to CloudFlare's servers, but yourdomain.com (without www) is not. Since the SSL certificates we offer are valid for both yourdomain.com and www.yourdomain.com, there is no problem to redirect your HTTP traffic to CloudFlare's servers and at the same time direct your HTTPS traffic to the server where your SSL certificate is installed.

To make the necessary changes for your OpenCart application, you need to edit the config.php files located in the OpenCart installation folder and in the admin folder. You need to modify the following lines and set them as follows:

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

 

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

Note that if you would prefer to have your SSL work via www.yourdomain.com and continue using CloudFlare, the only solution is to upgrade your CloudFlare account to Plus. This can be done from the Order section of your SiteGround User Area.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to configure CS-Cart to work with CloudFlare and SSL

The free CloudFlare account that comes with every Hostlantern shared and semi-dedicated hosting...

How to enable CloudFlare for a subdomain with a Free or PLUS CloudFlare plan

CloudFlare services are enabled for a given domain name and once activated can also be applied...

Java Applets not working via browser with active CloudFlare?

In case you have JavaScript that is trying to load Java Applets on your website and you are...

Can CloudFlare protect my website from a DDoS attack?

One of the major features of CloudFlare is that its traffic pipe is very large and distributed...

Does CloudFlare offer any security protection?

CloudFlare is designed to protect your website from many types of malicious online activities...