THinkPHP 5.0 域名路由

1、hinkPHP支持完整域名、子域名和IP部署的路由和绑定功能

要启用域名部署路由功能,首先需要开启:

/App/config.php

'url_domain_deploy' =>  true

 

2、路由配置文件route.php,加入以下几行代码

Route::domain('www.sn1987.com', 'index');
Route::domain('sn1987.com', 'index');
Route::domain('admin.sn1987.com', 'admin');
return [
	//topic路由
	['manran', 'topic/Index/index', []]
];

 

posted @ 2020-08-28 15:54  pinkpolk  阅读(272)  评论(0编辑  收藏  举报