Skip to content

Instantly share code, notes, and snippets.

@karamansky
Last active December 26, 2022 13:16
Show Gist options
  • Save karamansky/03135673343c6e57265834e2373d12ea to your computer and use it in GitHub Desktop.
Save karamansky/03135673343c6e57265834e2373d12ea to your computer and use it in GitHub Desktop.
function blg_current_location()
{
if (isset($_SERVER['HTTPS']) &&
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$protocol = 'https://';
} else {
$protocol = 'http://';
}
return $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment