S
S
Sadykh Sadykh2015-11-18 19:21:13
Yii
Sadykh Sadykh, 2015-11-18 19:21:13

Yii2 in a subdirectory?

Hello gentlemen.
The situation is the following. There is a site - site.ru (let's say the root directory is /var/www/). Yii2 is located in the /var/www/section directory.
Therefore, the input script is available at site.ru/section/web/index.php. Web server - Apache.
Question. What you need to specify in the .htaccess file so that:
1. The main page of the site is available at site.ru/section
2. For the CNC to work and beautiful addresses are picked up by the input script. Those. site.ru/section/news - opened the news controller.
Unfortunately, googling and standard answers to the question did not help, I'm not very friendly with .htaccess.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
A1eksandr, 2015-11-19
@Sadykh

1) it is better to do this through setting up the apache virtual host by setting DocumentRoot /var/www
/
section -0
2) Next, to build the CNC, you need to edit the routing rules through urlManager (settings file /config/main.php)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question