Skip to content

Instantly share code, notes, and snippets.

@kevindaus
Created September 17, 2016 12:03
Show Gist options
  • Save kevindaus/1d82bcfb76f185fc22f07a7b238f103b to your computer and use it in GitHub Desktop.
Save kevindaus/1d82bcfb76f185fc22f07a7b238f103b to your computer and use it in GitHub Desktop.
/*HTTPS for prod*/
if (!defined('YII_DEBUG')) {
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("HTTP/1.1 301 Moved Permanently");
header("Location: $redirect");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment