T
T
Tzeentch2014-06-25 22:17:59
Yii
Tzeentch, 2014-06-25 22:17:59

Yii2: how to set DocumentRoot?

Tell me how to set the correct DocumentRoot for the site. There is a folder with the site www.mysite.com. It contains the source code for the basic application. In view of the very low-quality hosting, it is not possible to change the host folder for the host. In the bark is the htaccess file in which I wrote
RewriteCond %{REQUEST_URI} !web/
RewriteRule (.*) /web/$1 [R=301,L]
This helps, but links are formed like this /web/site/login and so on. Without specifying /web/ pages are not processed.
I would be grateful for advice!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2014-06-25
Protko @Fesor

cannot be changed

Br...
If there is access via SSH - a symlink to the web folder and that's it. It is not necessary to produce any castles.
If symlinks are not allowed (although this is wildly sad), then simply move the entry point to the directory above. Cast irons with rewrites - not very good.

I
Ivan, 2014-06-25
@0neS

Try like this:

RewriteEngine on
RewriteRule ^((?!web/).*)$ web/$1 [L,NC]

D
dotzero, 2014-06-27
@dotzero

Look aside https://github.com/kartik-v/yii2-app-practical this template just gets rid of /web

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question