D
D
Dmitry Sonko2012-09-20 08:48:43
Apache HTTP Server
Dmitry Sonko, 2012-09-20 08:48:43

Alias ​​on a file

There are several hosts that are running on the same machine. Test hosts. It was necessary to close hosts from indexing by robots. Currently, hosts are constantly bound to different folders. How can the problem be solved? It comes to mind to give robots on all hosts with a ban on indexing, but throwing robots into each folder is not a solution. How can this be done at the configuration level?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
ertaquo, 2012-09-20
@ertaquo

At the configuration level, you can write a line in each VirtualHost:
Alias /robots.txt /var/ww/robots.txt
How to do this globally, alas, I don’t know.

S
script88, 2012-09-20
@script88

it is impossible to restrict access to certain addresses by means of allow from IP in any way?

N
Nikolai Turnaviotov, 2012-09-20
@foxmuldercp

1. Apache has the concept of global configuration and virtualhost configuration - accordingly, the file can be registered for all virtualhosts once.
2. put one robots.txt somewhere where the user running Apache has access and in the directories where the virtual hosts are located, make a symlink to this same robots.txt, then it will change for all virtual hosts where the symlinks are located on him at the same time.

D
Dmitry Sonko, 2012-09-20
@SonkoDmitry

Issue resolved. The problem was for some reason if the file for which the alias was created was called robots.txt, renamed to _robots.txt everything started. Forcibly added an alias to the module in the config:

Alias ​​/robots.txt "/media/DATA1/DISK1/wwwroot/_sites/robots/_robots.txt"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question