How to Install OpenCart SSL Certificate?
Firstly, let's briefly explain to those who do not know OpenCart. OpenCart is ecommerce software built on open source PHP. Because it is open source, it allows OpenCart software to be developed with the knowledge of everybody. There are many e-commerce sites that use OpenCart because it is easy to use and develop.
An SSL certificate is an essential feature for e-commerce sites. Because in e-commerce sites, customers enter sensitive data such as credit cards. This data must be transferred safely and protected and for this you need to use SSL certificate. You can learn more about the SSL certificate from our What is an SSL Certificate? Why Use SSL? article.
Purchase SSL Certificate
Firstly you need to purchase an SSL Certificate and this certificate needs to be installed on your server. You may have information about the installation steps from our How to Install an SSL Certificate? article. If you have purchased one of our SSL certificate products, we have free installation support if you request.
OpenCart SSL Settings
After completing the SSL certificate installation, log in to the OpenCart admin panel and activate the Use SSL
option under the Security heading under the System->Settings->Store Edit Button->Server
tab.
After this setting, we will complete the SSL setup after changing the config.php and admin/config.php files in the main directory where OpenCart software is installed.
Open and Find in config.php file.
define('HTTPS_SERVER', 'http://yoursiteaddress.com/');
Replace with the following.
define('HTTPS_SERVER', 'https://yoursiteaddress.com/');
In the same way, open admin/config.php and find the following code.
define('HTTPS_SERVER', 'http://yoursiteaddress.com/admin/');
define('HTTPS_CATALOG', 'http://yoursiteaddress.com/');
Replace with the following.
define('HTTPS_SERVER', 'https://yoursiteaddress.com/admin/');
define('HTTPS_CATALOG', 'https://yoursiteaddress.com/');
Making All Links SSL
After the above steps, the SSL certificate will be activated on the pages where customer data is entered, such as payment, registration etc. on your e-commerce site. However, if you want to use SSL for all your links on your site, replace all of your addresses beginning with http://
with https://
in the above files.
Https Redirect
As a final step, find the RewriteBase /
code in your .htaccess
file and add the following code.
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
If you are not using your site address with www prefix, make following change in above code.
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
If %{HTTP_HOST}%{REQUEST_URI}
in the above code doesn't work, you can write your site address instead. For example, as follows.
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule .* https://yoursiteaddress.com%{REQUEST_URI} [L,R=301]
After all these changes, all links on our site will work as https
.
You can purchase from our SSL Certificates products for secure e-commerce and benefit from our OpenCart free SSL setup support.
Sectigo PositiveSSL Certificate
Sectigo PositiveSSL, 128 bit SSL Certificates are designed for encrypting web sites for low volume online transactions. Trusted by over 99.9% of curre..
OpenCart Improved Attributes
OpenCart Improved Attributes, provide a better experience by adding new settings to the default properties. By assigning feature groups to different p..
Extreme Web Hosting
Extreme web hosting package is a non-limiting package of disk space, traffic, etc. features as with the premium package. Featuring unlimited features,..
Sectigo PositiveSSL EV Certificate
The PositiveSSL EV is a revolutionary product in that it expands access to Extended Validation SSL. In the past EV SSL was viewed more as a luxury for..
RapidSSL Certificate
RapidSSL is the fastest and most cost-effective solution for entry-level e-commerce sites, web-based e-mail, and any other application that requires s..
Symantec Secure Site Pro with EV
If you truly want to invest in the trust, credibility, and assurance of your website, there is no better option than the Symantec Secure Site Pro w/ E..
Thawte SSL123 Certificate
Thawte SSL123 is one of the fastest and most economical solutions for applications such as e-commerce sites, web-based e-mail that require a site secu..