Answer the question
In order to leave comments, you need to log in
How to make a substitution for another file in .htaccess?
you need to make a substitution from a file to another depending on the subdomain,
for example, if novgorod.site.ru/robots.txt then it should open novgorod.robots.txt
subdomains and the name of robots are the same
Answer the question
In order to leave comments, you need to log in
Option?
RewriteCond %{HTTP_HOST} ^(www\.)?01pr\.ru$ [NC]
RewriteRule ^robots.txt robots.ufa.txt [L]
RewriteRule ^favicon.ico /icons/ufa/favicon.ico [L]
Redirect 301 http://novgorod.site.ru/robots.txt http://novgorod.site.ru/folder/robots.txt
The redirect to the file should work, but if you have nginx + apache, then obviously not.
You will need to write a redirect in nginx itself since file requests do not reach Apache in principle.
Try this to start.
or
RewriteRule ^robots\.txt$ /folder/robots.txt? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question