On the server there is a user folder, in it there is a folder with the domain of the future site, for example site.com .
I put composer in the user’s folder and say when installing the framework into the site.com folder. It is placed and I see that index.php and robots.txt not in site.com but in site.com/web you have to reconfigure the web server now so that it looks in another folder? namely site.com/web ?
htaccesswith redirection in the root of the site, as well as in thewebfolder ....... an example is here: ru.stackoverflow.com/a/517861/191482 - Alexey Shimansky