V
V
Victor Umansky2017-07-11 01:19:53
Yii
Victor Umansky, 2017-07-11 01:19:53

Yii2-advanced: Alternate folder layout for multiple applications?

Hello everyone, looking in Google for the answer to my question, I found what I need
. I do everything according to the instructions, but I can’t set up .htacces in any way
And how to remove apps
ac1f715dc2.png

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
</IfModule>
<IfModule mod_rewrite.c>
    # если /admin, то в backend
    RewriteCond %{REQUEST_URI} ^/(admin)
    RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
    RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]
    RewriteRule ^admin/js/(.*)$ backend/web/js/$1 [L]
    RewriteRule ^admin/libs/(.*)$ backend/web/libs/$1 [L]
    RewriteRule ^admin/img/(.*)$ backend/web/img/$1 [L]
    RewriteRule ^admin/plugins/(.*)$ backend/web/plugins/$1 [L]
    RewriteCond %{REQUEST_URI} !^/backend/web/(assets|js|css|js)/
    RewriteCond %{REQUEST_URI} ^/(admin)
    RewriteRule ^.*$ backend/web/index.php [L]
    RewriteCond %{REQUEST_URI} ^/(assets|css|js|images)
    RewriteRule ^assets/(.*)$ apps/web/assets/$1 [L]
    RewriteRule ^css/(.*)$ appss/web/css/$1 [L]
    RewriteRule ^js/(.*)$ apps/web/js/$1 [L]
    RewriteRule ^images/(.*)$ apps/web/images/$1 [L]
    RewriteRule ^(.*)$ apps/web/$1 [L]
    RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|js)/
    RewriteCond %{REQUEST_URI} !index.php
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ apps/web/index.php
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
davidnum95, 2017-07-11
@davidnum95

It seems to me that this is not done by apache, but by means of yii2 itself by dividing the project into modules and setting up the correct router.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question