<?php
$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '',
'baseUrl' => 'http://testadmin.website.com/',
],
],
'defaultRoute' => 'form-info',
];
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
}
return $config;
上面的例子是在run/environments/dev/backend/config/main-local.php中设置后台基础url,设置baseurl参数即可,设置前台基础url以此类推