使用Yii2高级模板()后,前端和后端需要不同的文档根。
Set document roots of your Web server:
for frontend /path/to/yii-application/frontend/web/ and using the URL http://frontend/
for backend /path/to/yii-application/backend/web/ and using the URL http://backend/
在我的本地机器中,我已经设置了apache,并将虚拟主机配置为具有指向后端的别名。
<VirtualHost ..
来自:
它的工作,但我已经创建了另一个后端。
这是我的.htaccess配置:
RewriteEngine On
# End the processing, if a rewrite already occurred
RewriteRule ^(frontend|backend2)/web/ - [L]
RewriteRule ^(frontend|backend)/web/ - [L]
# Handle the case of backend, skip ([S=1]) the following rule, if current matched
RewriteRule ^b