Files
open-ww3-project-ww3-tw/public/index.php
2025-08-19 13:10:29 +08:00

27 lines
534 B
PHP
Executable File

<?php
$request_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
// 定义条件
$found_route = false;
switch($request_uri){
case '/':
include './re_blog.php';
break;
}
// posts 路由
include "./request/posts.php";
// 所有路由匹配结束后,检查是否找到路由
if (!$found_route) {
// 设置 HTTP 状态码为 404
header("HTTP/1.0 404 Not Found");
// 包含 404 页面文件
exit();
include "../src/views/error/404.html";
}