Commit 9fd46fc4ad7a8e6151bed727c3d5c49ea4548051

Authored by Alex Savenko
2 parents 71bd2430 eaa321f3

Merge branch 'master' of gitlab.artweb.com.ua:steska/clinica

Showing 1 changed file with 14 additions and 1 deletions   Show diff stats
frontend/config/main.php
@@ -9,6 +9,17 @@ @@ -9,6 +9,17 @@
9 ); 9 );
10 10
11 return [ 11 return [
  12 + 'on beforeRequest' => function () {
  13 + $pathInfo = Yii::$app->request->pathInfo;
  14 + $query = Yii::$app->request->queryString;
  15 + if (!empty($pathInfo) && substr($pathInfo, -1) === '/') {
  16 + $url = '/' . substr($pathInfo, 0, -1);
  17 + if ($query) {
  18 + $url .= '?' . $query;
  19 + }
  20 + Yii::$app->response->redirect($url, 301);
  21 + }
  22 + },
12 'id' => 'app-frontend', 23 'id' => 'app-frontend',
13 'homeUrl' => '/', 24 'homeUrl' => '/',
14 'basePath' => dirname(__DIR__), 25 'basePath' => dirname(__DIR__),
@@ -362,7 +373,9 @@ @@ -362,7 +373,9 @@
362 'baseUrl' => '/', 373 'baseUrl' => '/',
363 'enablePrettyUrl' => true, 374 'enablePrettyUrl' => true,
364 'showScriptName' => false, 375 'showScriptName' => false,
365 - 'rules' => [], 376 + 'rules' => [
  377 +
  378 + ],
366 'hideDefaultLanguagePrefix' => true, 379 'hideDefaultLanguagePrefix' => true,
367 ], 380 ],
368 ], 381 ],