Answers for "force https redirect php s"

PHP
0

force https redirect php s

if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === "off") {
    $location = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: ' . $location);
    exit;
}
Posted by: Guest on February-26-2022

Code answers related to "force https redirect php s"

Browse Popular Code Answers by Language