From 7a3cca71d5364ac93e31b6092b5dce9078634fe2 Mon Sep 17 00:00:00 2001 From: mr Date: Mon, 13 Jun 2016 14:11:08 +0300 Subject: [PATCH] SEO --- .htaccess | 1 - frontend/config/main.php | 1 + frontend/controllers/SiteController.php | 9 +++++++++ frontend/views/layouts/main.php | 20 ++++++++++---------- frontend/views/site/robots.php | 15 +++++++++++++++ frontend/web/robots.txt | 15 ++++++++++++++- 6 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 frontend/views/site/robots.php diff --git a/.htaccess b/.htaccess index f20cd79..afeba38 100644 --- a/.htaccess +++ b/.htaccess @@ -43,7 +43,6 @@ AddDefaultCharset utf-8 RewriteRule ^.*$ backend/web/index.php [L] - RewriteCond %{REQUEST_URI} ^/(assets|css) RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L] diff --git a/frontend/config/main.php b/frontend/config/main.php index 372b825..f32cbb9 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -79,6 +79,7 @@ return [ ], 'priceparam.xml' => 'site/priceparam', 'price.xml' => 'site/price', + 'robots.txt' => 'site/robots', 'smstest' => 'site/sms', // 'catalog' => 'catalog/all', // 'catalog/' => 'catalog/index', diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 31a6284..a7c30d4 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -36,6 +36,15 @@ class SiteController extends Controller ]); } + + public function actionRobots() + { + + return $this->renderPartial('robots', [ + + ]); + } + public function actionError(){ return $this->render('error', [ diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 00da8a6..b8d0f06 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -64,15 +64,6 @@ $this->registerJsFile (Yii::$app->request->baseUrl . '/js/fix_height.js', ['posi }); ", View::POS_READY); -$this->registerJs(" -(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), -m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) -})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); - -ga('create', 'UA-75674711-1', 'auto'); -ga('send', 'pageview'); - ", View::POS_BEGIN); // AssetBundle jcarousel :D [close] @@ -94,7 +85,16 @@ ga('send', 'pageview'); - + + diff --git a/frontend/views/site/robots.php b/frontend/views/site/robots.php new file mode 100644 index 0000000..04e4c10 --- /dev/null +++ b/frontend/views/site/robots.php @@ -0,0 +1,15 @@ +User-agent: * + +Disallow: /*reg + +Disallow: /basket + +Disallow: /login + +Disallow: /*from=adwords + +Disallow: /*utm_source= + +Host: www.rukzachok.com.ua + +Sitemap: http://www.rukzachok.com.ua/sitemap.xml \ No newline at end of file diff --git a/frontend/web/robots.txt b/frontend/web/robots.txt index 8093c87..2e30659 100755 --- a/frontend/web/robots.txt +++ b/frontend/web/robots.txt @@ -1,2 +1,15 @@ User-agent: * -Disallow: \ No newline at end of file + +Disallow: /*reg + +Disallow: /basket + +Disallow: /login + +Disallow: /*from=adwords + +Disallow: /*utm_source= + +Host: www.rukzachok.com.ua + +Sitemap: http://www.rukzachok.com.ua/sitemap.xml \ No newline at end of file -- libgit2 0.21.4