Commit 9fd46fc4ad7a8e6151bed727c3d5c49ea4548051
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 | 9 | ); |
10 | 10 | |
11 | 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 | 23 | 'id' => 'app-frontend', |
13 | 24 | 'homeUrl' => '/', |
14 | 25 | 'basePath' => dirname(__DIR__), |
... | ... | @@ -362,7 +373,9 @@ |
362 | 373 | 'baseUrl' => '/', |
363 | 374 | 'enablePrettyUrl' => true, |
364 | 375 | 'showScriptName' => false, |
365 | - 'rules' => [], | |
376 | + 'rules' => [ | |
377 | + | |
378 | + ], | |
366 | 379 | 'hideDefaultLanguagePrefix' => true, |
367 | 380 | ], |
368 | 381 | ], | ... | ... |