Last active
June 8, 2019 07:19
-
-
Save ennjoy/8fea5f834e344c655f7009fc40801d88 to your computer and use it in GitHub Desktop.
code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$server_scheme = @$_SERVER["HTTPS"]; | |
$pageURL = ($server_scheme == "on") ? "https://" : "http://"; | |
$http_url = $pageURL . $_SERVER['HTTP_HOST']; | |
$url = parse_url($wo['config']['site_url']); | |
if (!empty($url)) { | |
if ($url['scheme'] == 'http') { | |
if ($http_url != 'http://' . $url['host']) { | |
header('Location: ' . $wo['config']['site_url']); | |
exit(); | |
} | |
} else { | |
if ($http_url != 'https://' . $url['host']) { | |
header('Location: ' . $wo['config']['site_url']); | |
exit(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment