我已经安装了Yii2 高级应用模板。但是虚拟主机有问题。
我想用 url: 运行前端部分,用: 运行http://test_project/后端部分http://test_project/app/。
但是当我打开http://test_project/app/(前端部分工作正常)时,我得到 404 错误。这是我的vhosts config:
#test_project frontend
<VirtualHost *:80>
Servername test_project
DocumentRoot /var/www/test_project/frontend/web
<Directory /var/www/test_project/frontend/web>
Allow from all
AllowOverride All
Order allow,deny
</Directory>
</VirtualHost>
#test_project backend
<VirtualHost *:80>
DocumentRoot /var/www/test_project/backend/web
Servername test_project
ServerPath /app/
RewriteEngine On
<Directory /var/www/test_project/backend/web>
Allow from all
AllowOverride All
Order allow,deny
</Directory>
</VirtualHost>
Note:由于一些限制,我不能使用子域(但它工作正常)。
感谢帮助。