в корне проекта есть .htaccess в нем у меня написано:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/(assets|css|js|images|storage)
RewriteRule ^assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^css/(.*)$ backend/web/css/$1 [L]
RewriteRule ^js/(.*)$ backend/web/js/$1 [L]
RewriteRule ^images/(.*)$ backend/web/images/$1 [L]
RewriteRule ^storage/(.*)$ backend/web/storage/$1 [L]
RewriteRule ^(.*)$ backend/web/$1 [L]
RewriteCond %{REQUEST_URI} !^/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ backend/web/index.php
</IfModule>
в папке web тоже есть .htaccessв нем я пишу
# use mod_rewrite for pretty URL support
Options -Indexes
RewriteEngine on
# If a directory or a file exists, use the request directly
#RewriteCond %{REQUEST_URI} ^/(storage)
#RewriteRule ^/storage/(.*)/documents/(.*)$ /storage/db/documents/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
ссылка на статью
https://xn--d1acnqm.xn--j1amh/%D0%B7%D0%B0%D0%BF%D...