$nama_awal_server=substr($_SERVER['SERVER_NAME'],0,3); if($nama_awal_server!="www"){ $url="https://www.".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; header("location:$url"); exit; } if($_SERVER['HTTPS']!="on"){ $url="https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; header("location:$url"); exit; } ?>