Skip to content

Instantly share code, notes, and snippets.

@mrintegrity
Created January 14, 2013 13:11
Show Gist options
  • Save mrintegrity/4529958 to your computer and use it in GitHub Desktop.
Save mrintegrity/4529958 to your computer and use it in GitHub Desktop.
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['HTTPS'] = 'on';
}
else {
$_SERVER['HTTPS']='';
}
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {
$base_url = 'https://' . $_SERVER['HTTP_HOST'];
}
else {
$base_url = 'http://' . $_SERVER['HTTP_HOST'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment