ThinkPhp5 訪問二級域名模塊


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM