I use Yii 2 Advanced. No matter how I look at the solution, it all comes down to the appearance of the address bar: http://localhost:8888/yii2-app-advanced/backend/web/mytable/create .

I want this:

yii2-app-advanced - root frontend

yii2-app-advanced/admin - root backend

  • What exactly is the problem? Now it is described what I want, but what does not work out - no. - etki

1 answer 1

This can be achieved by means of a web server (from Apache via alias, for example). In this case, the physical structure of files of the same advanced example will remain unchanged. As far as I understand you need something like this in Apache:

 DocumentRoot /var/www/yii2-app-advanced/frontend/web/ Alias /admin /var/www/yii2-app-advanced/backend/web/ 
  • Well, in the first yii, the urlmanager was also corrected via htacces. here you need to obviously go to apache? and a fuller answer is possible - des1roer
  • In yii1, the whole framework was out and what was to be closed through that very htaccess, in the second one it is assumed that only the input script and static stick out, and all the code is outside the web root. Hence the default structure of advanced applications, where the two entry points for the front and backend are at the same level in terms of the file structure, and not nested. Added an example with an apache in response. - kroder