How to force a wordpress site to use https

Force the use of https on a wordpress site. After doing the setup of SSL (install the certificate, etc) you must change the .htaccess to include the following:

<ifmodule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^micronosis\.com [NC] 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.micronosis.com/$1 [R,L] 
RewriteBase / RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</ifmodule> 

Here you have to change example for the name of your domain. If you are still chrome or firefox are reporting that there are insecure images (surely because they are being referenced as http://www.example.com/images/imagen.jpg) you have to add in the images folder or wherever the images are a .htaccess with the following content:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} folder 
RewriteRule ^(.*)$ https://www.example.com/folder/$1 [R,L] 

Here you have to change example for the name of your domain. After these changes chrome should indicate that the site is safe.

Do you want to talk with one of our experts?

Chat now
Use of this site constitutes acceptance of our terms of service and Privacy Policy @ 2019 macronosis | Template by/or based on Colorlib