瀏覽代碼

Merge branch 'dev'

master
Guillaume Bourgeois 5 年之前
父節點
當前提交
f759e9ffa0
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. +2
    -4
      common/config/main.php

+ 2
- 4
common/config/main.php 查看文件

@@ -41,10 +41,8 @@ $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 = Yii::$app->request->getAbsoluteUrl();
if (!empty($url) && substr($url, -1) == '/') {
$url = substr($url, 0, strlen($url) - 1);
Yii::$app->getResponse()->redirect($url, 301);
Yii::$app->end();

Loading…
取消
儲存