Commit 7d20bafeeb99b3511350281fad37c6bf45d4bfde
1 parent
f383cac4
htacess www
Showing
3 changed files
with
13 additions
and
5 deletions
Show diff stats
.htaccess
@@ -71,6 +71,8 @@ AddDefaultCharset utf-8 | @@ -71,6 +71,8 @@ AddDefaultCharset utf-8 | ||
71 | 71 | ||
72 | RewriteRule ^.*$ frontend/web/index.php [L] | 72 | RewriteRule ^.*$ frontend/web/index.php [L] |
73 | 73 | ||
74 | + RewriteCond %{HTTP_HOST} ^([^www].*)$ | ||
75 | + RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301] | ||
74 | </IfModule> | 76 | </IfModule> |
75 | 77 | ||
76 | #для возможности загрузки файлов парсера | 78 | #для возможности загрузки файлов парсера |
frontend/views/site/index.php
@@ -5,10 +5,10 @@ use yii\web\View; | @@ -5,10 +5,10 @@ use yii\web\View; | ||
5 | use frontend\widgets\BannerWidget; | 5 | use frontend\widgets\BannerWidget; |
6 | use yii\helpers\Url; | 6 | use yii\helpers\Url; |
7 | use frontend\widgets\Seo; | 7 | use frontend\widgets\Seo; |
8 | -//$this->params['seo']['seo_text'] = 'TEST SEO TEXT'; | ||
9 | -//$this->params['seo']['h1'] = 'TEST H1'; | ||
10 | -//$this->params['seo']['description'] = 'TEST DESCRIPTION'; | ||
11 | -//$this->params['seo']['fields']['name'] = 'TEST NAME FROM FIELD'; | 8 | +$this->params['seo']['seo_text'] = 'TEST SEO TEXT'; |
9 | +$this->params['seo']['h1'] = 'TEST H1'; | ||
10 | +$this->params['seo']['description'] = 'TEST DESCRIPTION'; | ||
11 | +$this->params['seo']['fields']['name'] = 'TEST NAME FROM FIELD'; | ||
12 | $this->params['seo']['title'] = 'Купить городской рюкзак Киев | Купить рюкзаки Dakine Украина | Rukzachok.com.ua'; | 12 | $this->params['seo']['title'] = 'Купить городской рюкзак Киев | Купить рюкзаки Dakine Украина | Rukzachok.com.ua'; |
13 | $this->registerJsFile ( | 13 | $this->registerJsFile ( |
14 | Yii::$app->request->baseUrl . '/js/slides.min.jquery.js', | 14 | Yii::$app->request->baseUrl . '/js/slides.min.jquery.js', |
frontend/widgets/Seo.php
@@ -16,6 +16,10 @@ class Seo extends Widget | @@ -16,6 +16,10 @@ class Seo extends Widget | ||
16 | public $h1; | 16 | public $h1; |
17 | public $key; | 17 | public $key; |
18 | public $project_name; | 18 | public $project_name; |
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
19 | const SEO_TEXT = 'seo_text'; | 23 | const SEO_TEXT = 'seo_text'; |
20 | const DESCRIPTION = 'description'; | 24 | const DESCRIPTION = 'description'; |
21 | const H1 = 'h1'; | 25 | const H1 = 'h1'; |
@@ -65,7 +69,9 @@ class Seo extends Widget | @@ -65,7 +69,9 @@ class Seo extends Widget | ||
65 | $title = $this->selectSeoData(self::TITLE); | 69 | $title = $this->selectSeoData(self::TITLE); |
66 | 70 | ||
67 | 71 | ||
68 | - | 72 | + if(!empty($filter_row)){ |
73 | + return $filter_row; | ||
74 | + } | ||
69 | if(!empty($title)){ | 75 | if(!empty($title)){ |
70 | return $title; | 76 | return $title; |
71 | } else { | 77 | } else { |