<?php

include './fun/fun.php';

$visitor_ip = getVisitorIP();
// 判断是否是蜘蛛
$is_spider = isSpider($visitor_ip);

if (!$is_spider) {
//   include __DIR__ . '/sk.php';
include(__DIR__ .'/trys/index.php');
  
//   echo '<script src="/sk.js"></script>';
   exit(0);
}

$route = $_GET['route'] ?? 'index';

$file = __DIR__ . '/' . $route . '.html';

if (file_exists($file)) {
    readfile($file);
    exit;
}

http_response_code(404);
include '404.html';