Files
open-ww3-project-ww3-tw/public/request/posts.php

33 lines
990 B
PHP
Executable File

<?php
switch($request_uri){
case '/blog/md/';
include '/var/www/owp/open-ww3-project-ww3-tw/md/inite.php';
exit(); // 执行成功立即结束
case '/blog/md/post/';
include '../src/views/post.php';
exit(); // 执行成功立即结束
break;
case '/blog/md/post/s/2025/07/30/';
header("Location: https://ww3.tw/blog/md/post/s/1");
exit(); // 执行成功立即结束
break;
case '/blog/md/post/s/2025/07/30';
header("Location: https://ww3.tw/blog/md/post/s/1");
exit(); // 执行成功立即结束
break;
}
$post_id = null; // 初始化 post_id 变量
switch(true){
case preg_match('/^\/blog\/md\/post\/s\/(\d+)$/', $request_uri, $matches):
$post_id = (int)$matches[1];
include "../src/views/posts.php";
exit(); // 执行成功立即结束
break;
}