Browse Source

Merge branch 'dev'

prodstable
Guillaume Bourgeois 5 years ago
parent
commit
b497eae64b
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      common/config/main.php

+ 7
- 5
common/config/main.php View File

return [ return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'on beforeRequest' => function () { 'on beforeRequest' => function () {
$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();
if(method_exists(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();
}
} }
}, },
'components' => [ 'components' => [

Loading…
Cancel
Save