Skip to content

Instantly share code, notes, and snippets.

@5iDS
Created July 12, 2014 04:36
Show Gist options
  • Save 5iDS/e4997f7ed8b31c27f8da to your computer and use it in GitHub Desktop.
Save 5iDS/e4997f7ed8b31c27f8da to your computer and use it in GitHub Desktop.
redirect to SSL
<?php
function redirectTohttps() {
if($_SERVER['HTTPS']!=”on”) {
$redirect= “https://”.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header(“Location:$redirect”);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment