1.云端配置DNS解析。
2.宝塔->网站->配置->子目录绑定->添加二级域名abc.baidu.com,子目录一样是public。
3.application/config.php url_domain_deploy => true,打开域名部署。
4.application/route.php 修改路由
return [
'__domain__' => [
'abc' => 'hello'
],
'[hello]' => [
'index' => 'hello/index/index',#访问地址 abc.baidu.com/hello/index
'getUserInfo' => 'hello/index/getUserInfo',#访问地址 abc.baidu.com/hello/getUserInfo
'getAmountDetail' => 'hello/Useramount/getAmountDetail',#访问地址 abc.baidu.com/hello/getAmountDetail
],
];