1RewriteEngine On
2RewriteCond %{HTTPS} off
3RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
1RewriteEngine On
2RewriteCond %{SERVER_PORT} 80
3RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
1//PUT THIS IN .htaccess
2
3RewriteEngine On
4RewriteBase /
5RewriteCond %{HTTP_HOST} !^gymstatistics\.altervista\.org [NC,OR]
6RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
7RewriteRule ^ https://gymstatistics.altervista.org%{REQUEST_URI} [NE,R=301,L]
1RewriteCond %{HTTPS} !=on
2RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
1if ($_SERVER['HTTPS'] != "on")
2{
3 $url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
4 header("Location: $url");
5 exit;
6}