Last active
January 26, 2016 23:41
-
-
Save steveosoule/4552542 to your computer and use it in GitHub Desktop.
htaccess block users
This file contains hidden or 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
# From: http://www.unitedforums.co.uk/vb/website-development-scripting/10926-how-block-wget.html | |
# Turn on mod_rewrite | |
RewriteEngine On | |
# Block undesirable requests in general | |
RewriteCond %{THE_REQUEST} ^GET\ http [NC,OR] | |
# Block undesirable requests specifically | |
RewriteCond %{REQUEST_URI} cs\.txt?$ [OR] | |
# Block undesirables by referrer | |
RewriteCond %{HTTP_REFERER} ^http://www\.ultraorganizer\.com [OR] | |
# Block undesirables by IP address | |
RewriteCond %{REMOTE_ADDR} ^194\.153\.113\.23 [OR] | |
# Block undesirables by user-agent | |
RewriteCond %{HTTP_USER_AGENT} ^bot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} grub [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} holmes [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} naver [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} Nutch [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} Pete-Spider [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} SBIder [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} Seekbot [NC,OR] | |
# The last item in the list must not have an OR | |
RewriteCond %{HTTP_USER_AGENT} wget [NC] | |
# Give them all a 403 Forbidden | |
RewriteRule .* - [F] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment