<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
</IfModule>

<IfModule mod_rewrite.c>
    # если /backend, то в backend
    RewriteCond %{REQUEST_URI} ^/(backend)
    RewriteRule ^backend/assets/(.*)$ backend/web/assets/$1 [L]
    RewriteRule ^backend/css/(.*)$ backend/web/css/$1 [L]
    RewriteRule ^backend/js/(.*)$ backend/web/js/$1 [L]
    RewriteRule ^backend/uploads/(.*)$ backend/uploads/$1 [L]
    RewriteCond %{REQUEST_URI} !^/backend/web/(assets|js|css|js)/
    RewriteCond %{REQUEST_URI} ^/(backend)
    RewriteRule ^.*$ backend/web/index.php [L]
    # если /control, то в control
    RewriteCond %{REQUEST_URI} ^/(control)
    RewriteRule ^control/assets/(.*)$ control/web/assets/$1 [L]
    RewriteRule ^control/css/(.*)$ control/web/css/$1 [L]
    RewriteRule ^control/js/(.*)$ control/web/js/$1 [L]
    RewriteRule ^static/(.*)$ control/web/app/static/$1 [L]
    RewriteRule ^control/uploads/(.*)$ control/uploads/$1 [L]
    RewriteCond %{REQUEST_URI} !^/control/web/(assets|js|css|js)/
    RewriteCond %{REQUEST_URI} ^/(control)
    RewriteRule ^.*$ control/web/index.php [L]
    # если /operator, то в operator
    RewriteCond %{REQUEST_URI} ^/(operator)
    RewriteRule ^operator/assets/(.*)$ operator/web/assets/$1 [L]
    RewriteRule ^operator/css/(.*)$ operator/web/css/$1 [L]
    RewriteRule ^operator/js/(.*)$ operator/web/js/$1 [L]
    RewriteRule ^operator/html/(.*)$ operator/web/html/$1 [L]
    RewriteRule ^static/(.*)$ operator/web/app/static/$1 [L]
    RewriteRule ^operator/uploads/(.*)$ operator/uploads/$1 [L]
    RewriteCond %{REQUEST_URI} !^/operator/web/(assets|js|css|js)/
    RewriteCond %{REQUEST_URI} ^/(operator)
    RewriteRule ^.*$ operator/web/index.php [L]
    # если /bitrix24, то в bitrix24
    RewriteCond %{REQUEST_URI} ^/(bitrix24)
    RewriteRule ^bitrix24/(.*)$ bitrix24/$1 [L]
    # если /bitrixApp, то в bitrixApp
    RewriteCond %{REQUEST_URI} ^/(bitrixApp)
    RewriteRule ^bitrixApp/(.*)$ bitrixApp/$1 [L]
    # общее
    RewriteCond %{REQUEST_URI} ^/(assets|css|js|images)
    RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
    RewriteRule ^css/(.*)$ frontend/web/css/$1 [L]
    RewriteRule ^js/(.*)$ frontend/web/js/$1 [L]
    RewriteRule ^images/(.*)$ frontend/web/images/$1 [L]
    RewriteRule ^(.*)$ frontend/web/$1 [L]
    RewriteCond %{REQUEST_URI} !^/(frontend|backend|control|operator|bitrix24)/web/(assets|css|js)/
    RewriteCond %{REQUEST_URI} !index.php
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ frontend/web/index.php
</IfModule>