diff --git a/frontend/config/main.php b/frontend/config/main.php index 46ed461..fdc357f 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -1,6 +1,7 @@ [ 'class' => SeoUrlManager::className(), 'enablePrettyUrl' => true, + 'redirects' => [ + DirectRedirects::className(), + ], 'showScriptName' => false, 'processRoutes' => [ 'page/view', diff --git a/frontend/models/DirectRedirects.php b/frontend/models/DirectRedirects.php new file mode 100644 index 0000000..38ee61b --- /dev/null +++ b/frontend/models/DirectRedirects.php @@ -0,0 +1,43 @@ + '/ru/o-klinike', + '/site/gallery' => '/ru/gallery', + '/blog/index' => '/ru/blog', + '/site/price' => '/ru/price', + '/site/contact' => '/ru/contacts', + '/persone/index' => '/ru/persons', + '/site/comments' => '/ru/comments', + ]; + + if (array_key_exists($url, $redirectArray)){ + $this->link = $redirectArray[$url]; + return true; + } + + return false; + } + + public function getLink(): string + { + return trim($this->link, "/"); + } + } \ No newline at end of file -- libgit2 0.21.4