Revision #146 has been created by rackycz on Oct 6, 2019, 9:38:15 PM with the memo:
web folder
« previous (#145) next (#147) »
Changes
Title
unchanged
Yii v2 snippet guide
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2
Content
changed
[...]
Note that **Yii::$app->request->baseUrl** returns "/myProject/web". No trailing slash.
**How to redirect web to subfolder /web**
---
Yii 2 has the speciality that index.php is hidden in the web folder. I didnt find in the official documentation the important info - how to hide the folder, because user is not interested in it? ...
Our demo applicati
no
n is placed in folder:
- C:\xampp\htdocs\basic\web\index.php[...]
```
... it only adds the word "web" into all URLs. But first we have to remove the word from URLs. Open file config/web.php and find section **request**. Add attribute **baseUrl**:
```[...]
],
```
Now things will work for you. But it might be needed to use different value for devel and producticve
web locationenvironment.
I will test this and if I find problems and solutions I will add them.
**Auto redirection from login to desired URL **
---[...]