浏览代码

Merge branch 'dev'

prodstable
父节点
当前提交
fb698b0bfd
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      common/config/main.php

+ 10
- 0
common/config/main.php 查看文件

@@ -40,6 +40,16 @@ $serverName = $_SERVER['SERVER_NAME'] ;

return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'on beforeRequest' => function () {
$app = Yii::$app;
$pathInfo = $app->request->pathInfo;
if (!empty($pathInfo) && substr($pathInfo, -1) == '/') {
$url = Yii::$app->request->getAbsoluteUrl();
$url = substr($url, 0, strlen($url) - 1);
Yii::$app->getResponse()->redirect($url, 301);
Yii::$app->end();
}
},
'components' => [
'user' => [
'class' => 'yii\web\User',

正在加载...
取消
保存