nginx配置 yii2_yii2 URL重写 nginx的配置

/project/protected/config/main.php

// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

'name'=>'My Web Application',

// preloading 'log' component

'preload'=>array('log'),

// autoloading model and component classes

'import'=>array(

'application.models.*',

'application.components.*',

),

'modules'=>array(

// uncomment the following to enable the Gii tool

/*

'gii'=>array(

'class'=>'system.gii.GiiModule',

'password'=>'Enter Your Password Here',

// If removed, Gii defaults to localhost only. Edit carefully to taste.

'ipFilters'=>array('127.0.0.1','::1'),

),

*/

),

// application components

'components'=>array(

'user'=>array(

// enable cookie-based authentication

'allowAutoLogin'=>true,

),

// uncomment the following to enable URLs in path-format

'urlManager'=>array(

'urlFormat'=>'path',

'showScriptName' => false,

'urlSuffix' => '.html',

'rules'=>array(

'/'=>'/view',

'//'=>'/',

'/'=>'/',

),

),

// database settings are configured in database.php

'db'=>require(dirname(__FILE__).'/database.php'),

'errorHandler'=>array(

// use 'site/error' action to display errors

'errorAction'=>'site/error',

),

'log'=>array(

'class'=>'CLogRouter',

'routes'=>array(

array(

'class'=>'CFileLogRoute',

'levels'=>'error, warning',

),

// uncomment the following to show log messages on web pages

/*

array(

'class'=>'CWebLogRoute',

),

*/

),

),

),

// application-level parameters that can be accessed

// using Yii::app()->params['paramName']

'params'=>array(

// this is used in contact page

'adminEmail'=>'webmaster@example.com',

),

);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值