Skip to content

Instantly share code, notes, and snippets.

@addisonhall
Created August 20, 2013 15:43
Show Gist options
  • Save addisonhall/6283199 to your computer and use it in GitHub Desktop.
Save addisonhall/6283199 to your computer and use it in GitHub Desktop.
PHP that successfully redirects http to https on Engine Hosting.
<?php
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off") {
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location: $redirect");
exit();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment