安装yii2高级。我无法在服务器上配置apache。它值得CentOS。 Apache配置如下。主站点:tickets.example.ru和管理区域在这里:tickets.example.com/admin
当您登录任何链接的管理面板时(示例' / admin / user / login'),Apache出于某种原因查找前端中的所有内容。认为管理员是一个控制者。
<VirtualHost *:443>
ServerName tickets.example.ru
ServerAdmin example@example.ru
Alias /admin "/var/www/vhost/tickets.example.ru/htdocs/backend/web/"
DocumentRoot "/var/www/vhost/tickets.example.ru/htdocs/frontend/web/"
Options FollowSymLinks
DirectoryIndex index.php index.html
RewriteEngine on
RewriteRule /\. - [L,F]
RewriteRule ^/admin$ /admin/ [L,PT]
<Directory /var/www/vhost/tickets.example.ru/htdocs/frontend/web/>
AllowOverride none
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule ^ index.php [L]
</Directory>
<Directory "/var/www/vhost/tickets.example.ru/htdocs/backend/web/">
RewriteEngine on
AllowOverride none
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward the request to index.php
RewriteRule ^ index.php [L]
</Directory>
<Directory "/var/www/vhost/tickets.example.ru/htdocs/phpMyAdmin/">
RewriteEngine on
AllowOverride All
</Directory>
ErrorLog /var/www/vhost/tickets.example.ru/logs/http_error.log
TransferLog /var/www/vhost/tickets.example.ru/logs/http_access.log