Skip to content

Instantly share code, notes, and snippets.

@peterlozano
Last active August 29, 2015 14:02
Show Gist options
  • Save peterlozano/e5d3ce13d10deb92d977 to your computer and use it in GitHub Desktop.
Save peterlozano/e5d3ce13d10deb92d977 to your computer and use it in GitHub Desktop.
Global apache security file

This should be placed in /etc/apache2/conf.d and will provide global robot exclusion for all sites in the server.

The /var/www/robots.txt content is provided.

<DirectoryMatch "/\.git">
Deny from all
Satisfy all
</DirectoryMatch>
Header set X-Robots-Tag "noindex, nofollow, noarchive, nosnippet, noodp, notranslate, noimageindex"
<Location "/robots.txt">
SetHandler None
</Location>
Alias /robots.txt /var/www/robots.txt
User-agent: *
Disallow: /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment