Как исключить из редиректа файл robots.txt

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
Перейти к:навигация, поиск
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Доступная цена


Как исключить из редиректа файл robots.txt

Чтобы исключить из перенаправления файл robots.txt добавьте перед редиректом строку:

  RewriteCond %{REQUEST_URI} !^/robots\.txt$

или

  RewriteCond %{REQUEST_URI} !robots.txt

то есть должно получиться вот так:

   RewriteCond %{REQUEST_URI} !^/robots\.txt$
   RewriteCond %{HTTP_HOST} ^site.com$ [NC]
   RewriteRule ^(.*)$ http://site.ru/$1 [L,R=301]