您已为您的OpenCart网站启用了SSL证书,但是它从某些页面中消失了? Apache服务器如果您的OpenCart存储在Apache服务器上运行,则本教程有效。 您可以采取以下措施来确保在线商店的每一页安全,并确保在线购物者放心浏览您的网站。.

步骤 1

在 cPanel 中使用您最喜爱的 FTP 客户或文件管理器,并编辑您的 .htaccessnfile.

OpenCart .htaccess
 

Step 2

Copy and Paste these 3 lines of code in the .htaccess file:
 

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Save & close!

Step 3

Edit your config.php file in the OpenCart root (underneath the .htaccess file in the above screenshot).

OpenCart config
 

Under the // HTTPS line, change the protocol from http to https.

Save & close!

Step 4

Repeat the same for the config.php file in your admin folder.

OpenCart Admin Folder
 

Open the config.php here:

Config OpenCart
 

Again, underneath the // HTTPS line change both http protocols to https.


 

Save & close!

Congratulations!

Now go back to your OpenCart website and go through the pages.

OpenCart SSL


You will see the SSL certificate active all around your website keeping each page secure.

Customers will now feel they’re browsing and shopping securely from your OpenCart store.

Secure OpenCart Checkout SSL

Summary

Share this tutorial if it helped you and subscribe to our blog for weekly updates with more helpful guides like this one.