How to redirect HTTP to HTTPS using .htaccess

If you installed your website at http:// previously, and would like to change it to https:// automatically , kindly insert the following code into your .htaccess file :

# Force HTTPS:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • ssl, https
  • 89 Users Found This Useful
Was this answer helpful?

Related Articles

Not Secure Padlock : 3 possible reasons & how to fix them

After installing WordPress, you might see this 'Not Secure ' icon on your website address bar....