мой htaccess в корне:
Код: Выделить всё
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/__storage
RewriteRule ^(.*)$ $1 [L]
RewriteCond %{REQUEST_URI} ^/cp
RewriteRule ^cp/assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^cp/css/(.*)$ backend/web/css/$1 [L]
RewriteCond %{REQUEST_URI} ^/cp
RewriteRule ^(.*)$ /backend/web/$1 [L]
RewriteRule ^(.*)$ /frontend/web/$1 [L]
</IfModule>
<Files ".gitignore">
Order Allow,Deny
Deny from all
</Files>
мой htaccess в frontend(backend)/web:
Код: Выделить всё
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>
мой конфиг common/main.php:
Код: Выделить всё
return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'bootstrap' => ['log'],
'components' => [
'assetManager' => [
'basePath' => '@webroot/assets',
'baseUrl' => '@web/assets'
],
'fileCache' => [
'class' => 'yii\caching\FileCache'
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['warning', 'error']
]
]
]
],
'language' => 'en-US',
'sourceLanguage' => 'en-US'
];
мой конфиг с env:
Код: Выделить всё
return [
'bootstrap' => ['debug', 'gii'],
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => '...',
'username' => '...',
'password' => '...',
'charset' => 'utf8',
'enableSchemaCache' => true,
'schemaCache' => 'fileCache',
'schemaCacheDuration' => 0
]
],
'modules' => [
'debug' => [
'class' => 'yii\debug\Module',
'allowedIPs' => ['*']
],
'gii' => 'yii\gii\Module'
]
];
мой конфиг main.php в бекенд:
Код: Выделить всё
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'bootstrap' => ['app\components\Bootstrap'],
'defaultRoute' => 'cp/default/index',
'homeUrl' => '/cp',
'components' => [
'session' => [
'flashParam' => '__flash_cp'
],
'user' => [
'identityClass' => 'app\components\UserIdentity',
'enableAutoLogin' => true,
'loginUrl' => ['cp/default/login'],
'identityCookie' => ['name' => '_identity_cp'],
'idParam' => '__id_cp',
'authTimeoutParam' => '__expire_cp',
'absoluteAuthTimeoutParam' => '__absoluteExpire_cp',
'returnUrlParam' => '__returnUrl_cp'
],
'request' => [
'baseUrl' => '/cp'
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false
]
],
'params' => $params
];