You are here

How to Force Redirect HTTP to HTTPS by Editing .htaccess File?

Edit .htaccess

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
code type: 
Taken from: 
https://serverguy.com/security/redirect-http-to-https/