V
V
Valeriy Donika2015-01-20 17:04:23
Yii
Valeriy Donika, 2015-01-20 17:04:23

YII2 Advanced CNC. How to access without frontend/web/ in url?

Delivered advanced application.
yiiadvance.lc/frontend/web
yiiadvance.lc/backend/web
_ _ _ _
_ _ backe... ???
ps Site on openserver.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Osher, 2015-01-20
@miraage

Specify the appropriate documentroot in the server configuration.

T
Terminaft, 2015-01-20
@Terminaft

For frontend: open domains in OpenServer and add yiiadvance.lc => (frontend/web folder)
For admin panel: you need to configure Alias ​​in Apache config + add a line to htaccess'e backend/web. Now I can’t write from memory how and what, but after 3 hours the laptop will be at hand and I will throw off the necessary config if no one writes the correct answer before me (I have it implemented exactly the same as you want)
UPD
1) In the virtual config Apache hosts (Advanced->Configuration->Apache-xy->Apache-x.y_vhost.conf) must be added at the beginning:

<VirtualHost *:80>
        ServerName yiiadvance.lc
        DocumentRoot "%sprogdir%/domains/yiiadvance.lc/frontend/web"
        Alias /admin "%sprogdir%/domains/yiiadvance.lc/backend/web"
        <Directory "%sprogdir%/domains/yiiadvance.lc/backend/web">
             Options +Indexes
             AllowOverride All
        </Directory>
</VirtualHost>

2) In .htaccess (yiiadvance.lc/backend/web/.htaccess) add the line:
RewriteBase /admin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question