配合占位符实现类似于 https://www.mxin.moe/admin@mxin.moe 的 GET 传参方式。
demo
├── index.php
├── .htaccess
└── template
├── home.php
└── test.php
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php;
}
location ~ /.ht {
deny all;
}
<?php
//路由器
$url = $_SERVER['REQUEST_URI']; //获取URL
switch ($url) {
case '/':
include("template/home.php");
break;
case '/test':
include("template/test.php");
break;
}
?>