Skip to content

Instantly share code, notes, and snippets.

@fititnt
Last active December 4, 2015 21:44
Show Gist options
  • Save fititnt/8bf91653fb6861b0c5bd to your computer and use it in GitHub Desktop.
Save fititnt/8bf91653fb6861b0c5bd to your computer and use it in GitHub Desktop.
.htaccess: set X-Robots-Tag noindex,nofollow for non-varnish requests (hide from search engines)
# Set X-Robots-Tag noindex,nofollow if not requested by Varnish-cache
# e.g. can hide content from Google if both varnish and apache are open
# Apache 2.4+
<If "-z %{HTTP:X-VARNISH}">
Header set X-Robots-Tag noindex,nofollow
</If>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment