diff --git a/.htaccess b/.htaccess index afeba38..b1e24c0 100644 --- a/.htaccess +++ b/.htaccess @@ -61,8 +61,10 @@ AddDefaultCharset utf-8 RewriteRule ^fonts/(.*)$ frontend/web/fonts/$1 [L] + RewriteRule robots.txt$ frontend/web/robots.txt [L] - RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|js|images|fonts|img|files)/ + + RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|txt|js|images|fonts|img|files)/ RewriteCond %{REQUEST_URI} !index.php diff --git a/frontend/config/main.php b/frontend/config/main.php index f32cbb9..d658fb4 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -79,7 +79,7 @@ return [ ], 'priceparam.xml' => 'site/priceparam', 'price.xml' => 'site/price', - 'robots.txt' => 'site/robots', + // '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 a7c30d4..c5c3e2b 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -40,6 +40,7 @@ class SiteController extends Controller public function actionRobots() { + $file = file_get_contents(robotsTxt, true);//получаем его содержимое return $this->renderPartial('robots', [ ]); -- libgit2 0.21.4