<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Le 06/08/2021 à 18:21, Francis Daly a
écrit :<br>
</div>
<blockquote type="cite" cite="mid:20210806162107.GJ11167@daoine.org">
<pre class="moz-quote-pre" wrap="">On Fri, Aug 06, 2021 at 04:20:56PM +0200, Vincent M. wrote:
Hi there,
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Is it possible to tell the second server to link the file robots.txt to
another file like robots-pro.txt?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Either of
location = /robots.txt { alias /var/www/website/prod/robots-pro.txt; }
location = /robots.txt { try_files /robots-pro.txt =404; }
should work.
In the first case, you list the absolute file name. In the second,
you list the file within the normal "root" directory.
Cheers,
f
</pre>
</blockquote>
<p><font face="Arial">Yes, helped me a lot. For the main domain I
did to block robots-denyall.txt:</font></p>
<font face="Arial"> location /robots-denyall.txt {<br>
return 404;</font><font face="Arial"><br>
}<br>
</font>
<p><font face="Arial"><br>
</font></p>
<p><font face="Arial">And for the subdomain which I don't want to be
referenced:</font></p>
<p><font face="Arial"> location = /robots.txt {<br>
alias
/var/www/mywebsite/prod/robots-denyall.txt;<br>
}<br>
<br>
</font></p>
<p><font face="Arial">Thank you :)<br>
</font></p>
<p><br>
</p>
</body>
</html>