{"id":1212,"date":"2020-09-22T06:51:30","date_gmt":"2020-09-22T06:51:30","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2020\/09\/22\/4468956-how-to-fix-the-mixed-content-error-in-opencart-at-hostinger\/"},"modified":"2025-08-27T07:10:36","modified_gmt":"2025-08-27T07:10:36","slug":"4468956-how-to-fix-the-mixed-content-error-in-opencart-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/4468956-how-to-fix-the-mixed-content-error-in-opencart-at-hostinger\/","title":{"rendered":"How to Fix the Mixed Content Error in OpenCart at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">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.<\/p><p class=\"no-margin\">To force HTTPS in your OpenCart website, first, ensure that <b>both config.php<\/b> files (the one in your root <b>public_html<\/b> directory and the one in the <b>\/admin\/config.php<\/b> directory) have HTTPS URLs leading to your domain:<\/p><ol>\n<li>\n<p class=\"no-margin\">Open each <b>config.php<\/b> file using the <a href=\"\/support\/7949267-how-to-use-the-file-editor-at-hostinger\" target=\"_blank\" class=\"intercom-content-link\">file editor<\/a>, and press <b>Ctrl+H<\/b> to open the replace tool<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Insert <b>http:\/\/<\/b> into the first field and <b>https:\/\/<\/b> into the second one<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Click on <b>All <\/b>next to <b>Replace<\/b>:<\/p>\n<\/li>\n<\/ol><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2020\/09\/a49d2ac9-5bef-4f36-93bd-121982d64ae1.jpg\" alt=\"The replace tool in the File Editor at Hostinger showing how to replace all\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Save the changes and reload your site &mdash; it should be working properly with HTTPS.<\/p><p class=\"no-margin\">If there still is some leftover mixed content on your site, go to the OpenCart admin dashboard and open <b>Settings <\/b>&rarr; <b>Server<\/b>. In the <b>Security <\/b>section, set <b>Use SSL<\/b> to <b>Yes<\/b>:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2020\/09\/207ada9b-4233-44d6-b6fb-6179844602e2.jpg\" alt=\"The OpenCart\" width=\"500\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">If the mixed content issue persists after completing the above steps, open your website&rsquo;s <b>.htaccess<\/b> file using the file manager (or <a href=\"\/support\/1583307-how-to-create-an-htaccess-file\" target=\"_blank\" class=\"intercom-content-link\">create it<\/a> if non-existent) and insert the following line of code:<\/p><pre><code>Header always set Content-Security-Policy: upgrade-insecure-requests<\/code><\/pre><p class=\"no-margin\">Save the changes and check your website using incognito mode to verify it&rsquo;s working with HTTPS.<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">If your website uses <b>symlinks<\/b>, applying the above-mentioned change to the<b> .htaccess<\/b> file is not recommended &#128161;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>All about mixed content issues and how to fix them in OpenCart<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[214],"tags":[],"class_list":["post-1212","post","type-post","status-publish","format-standard","hentry","category-mixed-content"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/4468956-how-to-fix-the-mixed-content-error-in-opencart-at-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/4468956-como-corregir-el-error-de-contenido-mixto-en-opencart-en-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/4468956-comment-corriger-l-erreur-de-contenu-mixte-dans-opencart\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/4468956-bagaimana-cara-mengatasi-error-konten-campuran-di-hostinger-opencart\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/4468956-como-corrigir-o-erro-de-conteudo-misto-no-opencart-hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1212"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1212\/revisions"}],"predecessor-version":[{"id":4742,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1212\/revisions\/4742"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}