N
N
nepster-web2014-03-01 01:32:58
PHP
nepster-web, 2014-03-01 01:32:58

How to specify site root directory in .htaccess?

I deal with this matter here:
https://github.com/vova07/yii2-start
Reached the moment:

Для frontend my/app/frontend/web определяем адрес http://frontend
Для backend my/app/backend/web определяем адрес http://backend

site.ru/frontend/web/ - the site is available at this address
site.ru/backend/web/ - here we have an admin panel
Please tell me how to shaman .htaccess in such a way that:
For site.ru, the working directory is / frontend/web/
And for site.ru/cpanel/ the working directory was /backend/web/

Answer the question

In order to leave comments, you need to log in

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


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 Borisovich, 2014-03-01
@Alexufo

after Yii 2. How to change backend and frontend url?
SEO url in urlManager yii

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question