A
A
Alexander Borisovich2014-01-09 16:05:27
Yii
Alexander Borisovich, 2014-01-09 16:05:27

Yii 2. How to change backend and frontend url?

Deployed Yii 2 with advanced application template.
At the root are two folders frontend and backend.
We configured the root via htaccess to the /frontend/web folder .
It was /frontend/web/index.php/site/index
Became /site/index - ok.
But paths to css files still remain through /frontend/web/css Is it possible to disable /frontend/web/
path generation globally in yyi2 settings (for menu items, scripts, etc.)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
nepster-web, 2014-03-01
@Alexufo


Options +FollowSymlinks
RewriteEngine On
# deal with admin first
RewriteCond %{REQUEST_URI} ^/(admin)
RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^admin/css/(.* )$ backend/web/css/$1 [L]
RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css)/
RewriteCond %{REQUEST_URI} ^/(admin)
RewriteRule ^.*$ backend/web/index .php [L]
RewriteCond %{REQUEST_URI} ^/(assets|css)
RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
RewriteRule ^css/(.*)$ frontend/web/css /$1 [L]
RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css)/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ frontend/web/index.php

A
Alexander Zelenin, 2014-01-09
@zelenin

and discard .htaccess, otherwise you will soon have to configure the same

A
Alexander Makarov, 2014-01-14
@SamDark

How is the URL manager configured?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question