https htaccess code example
Example 1: force .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https:
Example 2: http to https htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https:
Example 3: force https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https:
Example 4: redirect to http to https .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https:
</IfModule>
Example 5: force https htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https: