Activate https on a website – SSL Code for htaccess

Use the following codes to implement SSL for WordPress and Non-Wordpress Sites into htaccess file.

This will show the lock in the address bar.

Method #1 – WordPress Site – htaccess:

RewriteCond %{HTTP_HOST} test\.suitelife\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://test\.suitelife\.com/$1 [R,L]

Method # 2 – Non WordPress Site – htaccess:

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</div>