Answer the question
In order to leave comments, you need to log in
Why is it throwing a 500 error?
I write the following in htaccess
Shell
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Если запрос начинается с /administrator, то заменяем на /backend/web/
RewriteCond %{REQUEST_URI} ^/administrator
RewriteRule ^administrator\/?(.*) /backend/web/$1
# Добавляем другой запрос /frontend/web/$1
RewriteCond %{REQUEST_URI} !^/(frontend/web|backend/web|administrator)
RewriteRule (.*) /frontend/web/$1
# Если frontend запрос
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php
# Если backend запрос
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Если запрос начинается с /administrator, то заменяем на /backend/web/
RewriteCond %{REQUEST_URI} ^/administrator
RewriteRule ^administrator\/?(.*) /backend/web/$1
# Добавляем другой запрос /frontend/web/$1
RewriteCond %{REQUEST_URI} !^/(frontend/web|backend/web|administrator)
RewriteRule (.*) /frontend/web/$1
# Если frontend запрос
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php
# Если backend запрос
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question