Apache global robots.txt

 

 

方式2: httpd.conf

# Exclude all robots

Alias /robots.txt /path/to/robots.txt

<Location "/robots.txt">
    SetHandler None
</Location>

方式2: .htaccess

RewriteEngine on
RewriteRule ^/robots.txt$ /srv/robots.txt [NC, L]

 

robots.txt

User-agent: *
Disallow: /