composer create-project topthink/think tp
composer update topthink/framework
composer require topthink/think-multi-app
// 开启多应用
'auto_multi_app' => true
php think build demo
, demo 是应用名称index.php
, 注意:修改的是 public 目录下的.htaccess 文件
// TP官网隐藏index.php入口文件
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
// 设置默认从index.php入口文件进入; 域名+应用名+路由 访问admin应用 http://help10086.net/admin/qqqqq; 隐藏入口文件
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^admin(.*)$ admin.php [L,E=PATH_INFO:$1]
RewriteRule !^admin(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
config、lang、middleware、route、view
等文件夹到新应用中php think make:middleware Check
, middleware 文件夹名,Check 中间键文件名点击链接:免费下载BD VIP资源(非付费):
https://m.help1688.cn/wxaurl?wxid=14308881211