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 : 5 possible reasons & how to fix them

<English Version>   When you use your domain with NetKL hosting, you will receive SSL...