Answers for "how to redirect http to https"

1

how to redirect http to https

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Posted by: Guest on July-02-2020
0

redirect http to https

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
Posted by: Guest on April-14-2020
0

how to redirect http to https

//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]
Posted by: Guest on April-13-2020
1

redirect https

if ($_SERVER['HTTPS'] != "on") 
{
    $url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    header("Location: $url");
    exit;
}
Posted by: Guest on November-07-2020
0

http to https redirect

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Posted by: Guest on June-13-2021

Code answers related to "how to redirect http to https"

Browse Popular Code Answers by Language