From 40f6051334daa5a6de1fe6013d06613a8d7db02b Mon Sep 17 00:00:00 2001 From: timur Date: Wed, 22 Nov 2017 12:15:47 +0200 Subject: [PATCH] redirects --- common/models/DirectRedirect.php | 38 ++++++++++++++++++++++++++++++++++++++ frontend/config/main.php | 6 ++++++ frontend/views/site/index.php | 24 ++++++++++++------------ 3 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 common/models/DirectRedirect.php diff --git a/common/models/DirectRedirect.php b/common/models/DirectRedirect.php new file mode 100644 index 0000000..0a131dd --- /dev/null +++ b/common/models/DirectRedirect.php @@ -0,0 +1,38 @@ + '/ru', + '/site/about' => '/ru/about', + '/site/contact' => '/ru/contact', + ); + if (isset($urlArray[$url])){ + $this->link = $urlArray[$url]; + return true; + } + + return false; + } + + public function getLink(): string + { + return trim($this->link, "/"); + } + } \ No newline at end of file diff --git a/frontend/config/main.php b/frontend/config/main.php index 4e456e5..c878bd7 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -46,6 +46,12 @@ return [ 'class' => SeoUrlManager::className(), 'enablePrettyUrl' => true, 'showScriptName' => false, + 'redirects' => [ + \common\models\DirectRedirect::className() + ], + 'processRoutes' => [ + 'page/view', + ], 'rules' => [ '\/robots.txt' => 'site/robots', '/' => 'site/index', diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php index 1b36b91..2e42053 100755 --- a/frontend/views/site/index.php +++ b/frontend/views/site/index.php @@ -31,7 +31,7 @@ _________________________________________________________ -->
- + От сервис-провайдера “Облако”
@@ -63,7 +63,7 @@ _________________________________________________________ -->

- + Хостинг и аренда конфигурации Odoo
@@ -73,7 +73,7 @@ _________________________________________________________ -->
- + Управление продажами и проектами онлайн

Управление продажами и проектами онлайн

@@ -101,7 +101,7 @@ _________________________________________________________ -->

- + ERP в облаке
@@ -111,7 +111,7 @@ _________________________________________________________ -->
- + Odoo и ArtBox: интеграция с сайтом и интернет-магазином

Odoo и ArtBox: интеграция с сайтом и интернет-магазином

@@ -139,7 +139,7 @@ _________________________________________________________ -->

- Cloudbank + CloudBank
@@ -155,22 +155,22 @@ _________________________________________________________ --> -- libgit2 0.21.4