Commit 486e5dea2440a8e0e7d36bf1e2ba4e1afa73c624
1 parent
7a3cca71
SEO
Showing
3 changed files
with
5 additions
and
2 deletions
Show diff stats
.htaccess
@@ -61,8 +61,10 @@ AddDefaultCharset utf-8 | @@ -61,8 +61,10 @@ AddDefaultCharset utf-8 | ||
61 | 61 | ||
62 | RewriteRule ^fonts/(.*)$ frontend/web/fonts/$1 [L] | 62 | RewriteRule ^fonts/(.*)$ frontend/web/fonts/$1 [L] |
63 | 63 | ||
64 | + RewriteRule robots.txt$ frontend/web/robots.txt [L] | ||
64 | 65 | ||
65 | - RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|js|images|fonts|img|files)/ | 66 | + |
67 | + RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|txt|js|images|fonts|img|files)/ | ||
66 | 68 | ||
67 | RewriteCond %{REQUEST_URI} !index.php | 69 | RewriteCond %{REQUEST_URI} !index.php |
68 | 70 |
frontend/config/main.php
@@ -79,7 +79,7 @@ return [ | @@ -79,7 +79,7 @@ return [ | ||
79 | ], | 79 | ], |
80 | 'priceparam.xml' => 'site/priceparam', | 80 | 'priceparam.xml' => 'site/priceparam', |
81 | 'price.xml' => 'site/price', | 81 | 'price.xml' => 'site/price', |
82 | - 'robots.txt' => 'site/robots', | 82 | + // 'robots.txt' => 'site/robots', |
83 | 'smstest' => 'site/sms', | 83 | 'smstest' => 'site/sms', |
84 | // 'catalog' => 'catalog/all', | 84 | // 'catalog' => 'catalog/all', |
85 | // 'catalog/<translit:\w+>' => 'catalog/index', | 85 | // 'catalog/<translit:\w+>' => 'catalog/index', |
frontend/controllers/SiteController.php
@@ -40,6 +40,7 @@ class SiteController extends Controller | @@ -40,6 +40,7 @@ class SiteController extends Controller | ||
40 | public function actionRobots() | 40 | public function actionRobots() |
41 | { | 41 | { |
42 | 42 | ||
43 | + $file = file_get_contents(robotsTxt, true);//получаем его содержимое | ||
43 | return $this->renderPartial('robots', [ | 44 | return $this->renderPartial('robots', [ |
44 | 45 | ||
45 | ]); | 46 | ]); |