Last active
December 29, 2015 10:38
-
-
Save koehn/7657865 to your computer and use it in GitHub Desktop.
mod_rewrite configuration to send either a 410 (Gone) or a robots file with disallow * for any request to a domain other than one I own. I needed this because some Chinese company had been leasing the IP address that I got and still had dozens/hundreds of domain names pointed at my IP; I didn't want my app server getting these and/or redircting …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^.*koehn\.com$ | |
RewriteRule ^robots\.txt$ /robots-off.txt [L] | |
RewriteCond %{HTTP_HOST} !^.*koehn\.com$ | |
RewriteRule !^robots-off\.txt$ - [L,G] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment