Skip to main content
All CollectionsSSL CertificatesMixed Content
How to Fix the Mixed Content Error in OpenCart
How to Fix the Mixed Content Error in OpenCart

All about mixed content issues and how to fix them in OpenCart

Updated over 6 months ago

Mixed content occurs when you attempt to load images or other content using HTTP instead of HTTPS. To fix this, all you need to do is edit the links on your page so that they start with HTTPS instead.


To force HTTPS in your OpenCart website, first, ensure that both config.php files (the one in your root public_html directory and the one in the /admin/config.php directory) have HTTPS URLs leading to your domain:

  1. Open each config.php file using the file editor, and press Ctrl+H to open the replace tool

  2. Insert http:// into the first field and https:// into the second one

  3. Click on All next to Replace:

The replace tool in the File Editor at Hostinger showing how to replace all

Save the changes and reload your site — it should be working properly with HTTPS.


If there still is some leftover mixed content on your site, go to the OpenCart admin dashboard and open Settings Server. In the Security section, set Use SSL to Yes:

The OpenCart

If the mixed content issue persists after completing the above steps, open your website's .htaccess file using the file manager (or create it if non-existent) and insert the following line of code:

Header always set Content-Security-Policy: upgrade-insecure-requests

Save the changes and check your website using incognito mode to verify it's working with HTTPS.

If your website uses symlinks, applying the above-mentioned change to the .htaccess file is not recommended 💡

Did this answer your question?