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
],
];