Linux
- 2 ответа
- 0 вопросов
2
Вклад в тег
# Mod_Autoindex
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
# Mod_Rewrite
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
IndexIgnore */*
RewriteRule ^admin/(.*)?$ /backend/web/$1 [L,PT]
RewriteRule ^admin(.*)?$ /backend/web/$1 [L,PT]
RewriteRule ^([^/].*)?$ /frontend/web/$1
</IfModule>
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
use \yii\web\Request;
$baseUrl = str_replace('/backend/web', '', (new Request)->getBaseUrl());
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'backend\controllers',
'components' => [
'request' => [
'baseUrl' => $baseUrl . "/admin",
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'suffix'=>'/',
'rules'=>array(
''=>'site/index',
'<action>'=>'site/<action>',
),
],
],
'params' => $params,
];