Fix SSL Mixed Content Issues on WordPress

Ecowebzim

Administrator
Staff member
May 19, 2021
72
23
8
Bulawayo
www.ecowebzim.com
At times it is noticed that SSL is installed on a WordPress site but on the web browser the green padlock icon is not visible. This issue is caused by mixed content present in your site code.

Mixed content means there are some URLs with HTTP present on your website.

You can simply view the page source in your browser by right clicking on the page, click on ‘view page source’. Search for ‘http://’ you will see URLs present on your site.

There are two simple ways to solve this, either with a plugin or by adding a force redirection code in the .htaccess file of your domain.

First, solving this issue with a plugin.

If you have a WordPress website then there is a light and simple plugin for this called “SSL Insecure Content Fixer” by Webware.

ssl_insecure_fixer-768x232.png
There are two ways to install it, either install automatically through the WordPress admin, or download the .zip file, unzip to a folder, and upload the folder to your /wp-content/plugins/ directory and Activate the plugin through the ‘Plugins’ menu in WordPress.

For manual installation, you can download the plugin from here.

Method 2, by adding a code in the .htaccess file.

You have to log in to the cPanel account access to the file manager, locate the .htaccess file.

Login to your cPanel account - Go to the File Manager in your cPanel:

file_manager.png

Set your File Manager to show hidden files to see the .htaccess file:

locate_htaccess.png

Edit the .htaccess file:

edit.png

add the force redirection code provided below on the top of the .htaccess file code in the root folder of your domain..

Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?coolexample\.com
RewriteRule ^(.*)$ https://www.coolexample.com/$1 [R,L]

IMPORTANT: Make sure that the line RewriteEngine On is not repeated twice. In case the line already exists, simply copy the rest of the code without it.
 

Forum statistics

Threads
87
Messages
141
Members
63
Latest member
WendyB