1.云端配置DNS解析。
2.宝塔->网站->配置->子目录绑定->添加二级域名sb.baidu.com,子目录一样是public。
3.application/config.php url_domain_deploy => true,打开域名部署。
4.application/route.php 添加
use think\Route;
Route::domain(‘sb‘,‘sb/index/signin‘);
原文:https://www.cnblogs.com/litchimax/p/11585538.html