A
A
Artur Khismatullin2019-03-13 12:52:14
htaccess
Artur Khismatullin, 2019-03-13 12:52:14

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

as a result, even the config from the yii2 site does not work. I use OpenServer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-03-13
@NeiroNx

500 is an error in scripts. You need to watch error.log.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question