How to fix mixed content error in OpenCart?


Mixed content means that you are trying to load images or other content with HTTP instead of HTTPS in their links. To fix this, you would simply need to edit all the links on your page to have HTTPS at the beginning instead.

First, make sure that both config.php files (one in your root public_html directory and one in /admin/config.php directory) have HTTPS URLs leading to your domain. In the File Manager, you can easily perform the needed replacement: press Ctrl + H, insert http:// to the first field, and https:// to the second one. After this choose replace all:

If you still see some leftover mixed content, in your OpenCart admin dashboard open Settings โ†’ Server. In the Security section set Use SSL to Yes:

Now your website shall be working with HTTPS ๐Ÿ˜Š

If you still see that you have some Mixed content on the website, you can add this line to your .htaccess file:

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

It will also force all mixed content to use HTTPS.

That’s all! You are good to go and shall have your website displayed as Secure now! ๐Ÿ˜Š

We will be happy to hear your thoughts

Leave a reply

Compare items
  • Total (0)
Shopping cart