Commit 486e5dea2440a8e0e7d36bf1e2ba4e1afa73c624

Authored by Dmytry Fedorchuk
1 parent 7a3cca71

SEO

.htaccess
... ... @@ -61,8 +61,10 @@ AddDefaultCharset utf-8
61 61  
62 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 69 RewriteCond %{REQUEST_URI} !index.php
68 70  
... ...
frontend/config/main.php
... ... @@ -79,7 +79,7 @@ return [
79 79 ],
80 80 'priceparam.xml' => 'site/priceparam',
81 81 'price.xml' => 'site/price',
82   - 'robots.txt' => 'site/robots',
  82 + // 'robots.txt' => 'site/robots',
83 83 'smstest' => 'site/sms',
84 84 // 'catalog' => 'catalog/all',
85 85 // 'catalog/<translit:\w+>' => 'catalog/index',
... ...
frontend/controllers/SiteController.php
... ... @@ -40,6 +40,7 @@ class SiteController extends Controller
40 40 public function actionRobots()
41 41 {
42 42  
  43 + $file = file_get_contents(robotsTxt, true);//получаем его содержимое
43 44 return $this->renderPartial('robots', [
44 45  
45 46 ]);
... ...