Skip to content

Instantly share code, notes, and snippets.

@HighBreedTech
Forked from irazasyed/.htaccess
Created April 28, 2022 05:29
Show Gist options
  • Save HighBreedTech/f28968725d41f76668ff9c3e7d3b15be to your computer and use it in GitHub Desktop.
Save HighBreedTech/f28968725d41f76668ff9c3e7d3b15be to your computer and use it in GitHub Desktop.
htaccess: Disable URL indexing by crawlers (FOR DEVELOPMENT/STAGE)
# -----------------------------------------------------------------------------------------
# Disable URL indexing by crawlers (FOR DEVELOPMENT/STAGE)
# -----------------------------------------------------------------------------------------
# Avoid search engines (Google, Yahoo, etc) indexing website's content
# http://yoast.com/prevent-site-being-indexed/
# http://code.google.com/web/controlcrawlindex/docs/robots_meta_tag.html
# Matt Cutt (from Google Webmaster Central) on this topic:
# http://www.youtube.com/watch?v=KBdEwpRQRD0
# IMPORTANT: serving this headers is recommended only for
# development/stage websites (or for live websites that don't
# want to be indexed). This will avoid the website
# being indexed in SERPs (search engines result pages).
# This is a better approach than using robots.txt
# to disallow the SE robots crawling your website,
# because disallowing the robots doesn't exactly
# mean that your website won't get indexed (read links above).
# https://github.com/h5bp/html5-boilerplate/issues/804
# <IfModule mod_headers.c>
# Header set X-Robots-Tag "noindex, nofollow, noarchive"
# <FilesMatch "\.(doc|pdf|png|jpe?g|gif)$">
# Header set X-Robots-Tag "noindex, noarchive, nosnippet"
# </FilesMatch>
# </IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment