Answer the question
In order to leave comments, you need to log in
How to configure .htaccess in Yii2 so that a certain folder does not fall under the rules?
Hello. There was a problem with .htaccess.
In the root directory there is a directory called "dtf". And the problem is, when I go to the following path site.name/dtf/ymi - the main page of the site itself is displayed to me (which was frontend/web/site/index before.
.htaccess content:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(backend/web|admin)
RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^admin(.*) /backend/web/$1 [L]
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php [L]
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php [L]
Answer the question
In order to leave comments, you need to log in
Add 3rd line RewriteCond %{REQUEST_URI} !^/(dtf) :
RewriteCond %{REQUEST_URI} !^/(backend/web|admin)
RewriteCond %{REQUEST_URI} !^/(dtf)
RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question