Con la variable $_SERVER[‘HTTPS’]
if( isset($_SERVER[‘HTTPS’] ) ) {
$tipoHost = ‘https://’.$_SERVER[‘HTTP_HOST’].’/’;
}else{
$tipoHost = ‘http://’.$_SERVER[‘HTTP_HOST’].’/’;
}
Con la variable $_SERVER[‘HTTPS’]
if( isset($_SERVER[‘HTTPS’] ) ) {
$tipoHost = ‘https://’.$_SERVER[‘HTTP_HOST’].’/’;
}else{
$tipoHost = ‘http://’.$_SERVER[‘HTTP_HOST’].’/’;
}