xxxxxxxxxx
//PUT THIS IN .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^gymstatistics\.altervista\.org [NC,OR]
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^ https://gymstatistics.altervista.org%{REQUEST_URI} [NE,R=301,L]
xxxxxxxxxx
# Redirect HTTPS to HTTP
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
xxxxxxxxxx
# 301 REDIRECT HTTP TO HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
xxxxxxxxxx
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
xxxxxxxxxx
if ($_SERVER['HTTPS'] != "on")
{
$url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header("Location: $url");
exit;
}
xxxxxxxxxx
# Redirect all HTTP requests to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]