why http redirect to https code example
Example 1: how to redirect http to https
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^gymstatistics\.altervista\.org [NC,OR]
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^ https:
Example 2: redirect http non www to https www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https: