Sto provando queste 3 righe

port=$_SERVER['SERVER_PORT'];
//controlla se il protocollo utilizzato è HTTP,in tal caso trasferisce tutto in HTTPS
if ($port==80)
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']');


Secondo voi?