настроить Apache для yii2 starter kit

199
21 декабря 2021, 10:50

использую OpenServer на windows, установил yii2-starter-kit, но не могу настроить Apache в htaccess

# End the processing, if a rewrite already occurred
RewriteRule ^(frontend|admin|teacher|student)/web/ - [L]
# Handle the case of backend, skip ([S=1]) the following rule, if current matched
RewriteRule ^admin(/(.*))?$   backend/web/$2 [S=1]
RewriteRule ^teacher(/(.*))?$ teacher/web/$2 [S=1]
RewriteRule ^student(/(.*))?$ student/web/$2 [S=1]
# handle the case of frontend
RewriteRule .* frontend/web/$0
RewriteRule .* teacher/web/$0
RewriteRule .* admin/web/$0

RewriteRule .* student/web/$0

таким образом прописываю

<VirtualHost *:%httpport%>
    DocumentRoot    "%hostdir%"
    ServerName      "%host%"
    ServerAlias     "%host%" %aliases%
    ScriptAlias     /cgi-bin/ "%hostdir%/cgi-bin/"
 </VirtualHost>

<VirtualHost *:%httpport%>
    DocumentRoot    "%hostdir%/backend/web/"
    ServerName      "%host%"
    ServerAlias     "%host%"
    ScriptAlias     /cgi-bin/ "%hostdir%/cgi-bin/"
</VirtualHost>

<VirtualHost *:%httpport%>
    DocumentRoot    "%hostdir%/student/web/"
    ServerName      "%host%"
    ServerAlias     "%host%"
    ScriptAlias     /cgi-bin/ "%hostdir%/cgi-bin/"
</VirtualHost>

<VirtualHost *:%httpport%>
    DocumentRoot    "%hostdir%/teacher/web/"
    ServerName      "%host%"
    ServerAlias     "%host%"
    ScriptAlias     /cgi-bin/ "%hostdir%/cgi-bin/"
</VirtualHost>

так прописываю, но не работает, как правильно прописать хосты?

READ ALSO
Запрос insert PDO PHP

Запрос insert PDO PHP

Хочу записать все $value в таблицу users столбец lastnameКак?

161
Доступ к конфигу Chrome из расширения

Доступ к конфигу Chrome из расширения

Если у сайта проблемы с сертификатом, как правило, Chrome блокирует его открытиеПри помощи линка "Перейти на сайт (не безопасно)" сайт более не блокируется

69