Block Spam Spiders From Your Site & .htaccess Ip Ban

Started on the old forum in June 2007 · view the original in the archive · old links redirect here

12 replies · 2,131 views · started 19 years ago · 3 min read

TL;DR · summary of 12 replies
  • -metulj suggested blocking specified browsers in .htaccess.
  • -The thread did not conclude with a specific code approach or fix for blocking browsers.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
GumSlone Administrator Principal · 1,690 posts #1

All you need to block the spamspiders is to add this lines to your .htaccess

mod rewrite need to be installed on your server to use this.

RewriteEngine on

# Block spambots

RewriteCond %{HTTP_USER_AGENT} ^.*Whacker.*$ [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] 
RewriteCond %{HTTP_USER_AGENT} ^.*FileHound.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*TurnitinBot.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*JoBo.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*adressendeutschland.*$
RewriteRule ^.* - [F]

Increase your web site’s security by blocking bad visitors with .htaccess. If you have nuisance visitors, site scrapers, or spammers, you may want to add some lines of code to your .htaccess file that will block bad visitors by IP address or by blocks of IP addresses. You want to be careful though that you don’t ban blocks of IP’s carelessly as you may end up banning potential customers or other valid site visitors. Also, nothing is completely foolproof as the user can always use another IP address, but I’ve found that this does reduce the number of troublesome incidents.

Secure Directories by IP Address and/or Domain

# allow all except those indicated here
<Files *>
order allow,deny
allow from all
deny from 12.345.67.890
deny from .*domain\.com.*
</Files>

In the following example, all IP addresses are denied access except for 12.345.67.890 and domain.com:

# deny all except those indicated here
<Files *>
order deny,allow
deny from all
allow from 12.345.67.890
allow from .*domain\.com.*
</Files>

This is how to block unwanted visitors based on the referring domain. Simply replace “offendingdomain1″ and “offendingdomain2″ with the offending domains of your choice:

# block visitors referred from indicated domains
RewriteEngine on
RewriteCond %{HTTP_REFERER} offendingdomain1\.com [NC,OR]
RewriteCond %{HTTP_REFERER} offendingdomain2\.com [NC,OR]
RewriteRule .* - [F]

Deny or Allow Domain Access for a Specified IP Address Range

There are several effective ways to block a range of IP addresses via htaccess. This first method blocks an IP range specified by their CIDR (Classless Inter-Domain Routing) number. This method is useful for blocking mega-spammers such as RIPE, Optinet, and many others. If, for example, you find yourself adding line after line of Apache deny directives for addresses beginning with the same first few numbers, choose one of them and try a whois lookup. Listed within the whois results will be the CIDR value representing every IP address associated with that particular network. Thus, blocking via CIDR is an effective way to eloquently prevent all IP instances of the offender from accessing your site. Here is a generalized example for blocking by CIDR (edit values to suit your needs):

# block IP range by CIDR number
<Files *>
order allow,deny
allow from all
deny from 10.1.0.0/16
deny from 80.0.0/8
</Files>

AND here is a list with spam bot ips:

I also recommend this other list

that has the same function

http://www.emailharvest.com/ips.txt

It is recommended that IP addresses

be banned for no more than 30 days

Please watch out that you (or I) don't

ban 64.68.82.* addresses. These are

googlebot crawlers, which have been

showing up as spambots recently. Some

idiot spammer apparently wants me

to ban Google by accident

Also 216.239.39.5, which resolves

to some Google server.

Be aware that the following IP range

belongs to web proxy servers for Spanish

Telefonica 80.58.0.0 - 80.58.24.255

Added Dec 13

205.205.236.14 80.15.138.218 216.138.217.106 24.138.39.190

Added Nov 22

192.116.153.2 192.116.66.218 195.166.237.40 209.139.252.149 209.235.23.70 211.19.78.202 212.247.106.210 216.138.217.106 216.205.75.23 216.205.75.24 216.205.75.25 216.205.75.26 216.205.75.27 216.205.75.28 216.205.91.228 216.205.91.229 216.205.91.230 216.205.94.82 216.205.94.83 216.205.94.84 216.205.94.85 216.205.94.87 216.205.94.88 216.205.94.89 216.205.94.90 216.252.167.226 217.10.169.146 217.194.147.2 61.116.75.187 62.194.105.200 62.194.7.93 62.219.142.236 66.135.32.95 66.135.34.8 66.135.35.75 69.44.57.230 69.44.57.78 69.44.57.98 80.179.101.199 80.88.132.177 81.199.6.140 81.199.84.81 81.199.84.8 82.166.69.238

Added Oct 26

62.128.162.20 65.80.28.112 65.26.251.81 66.135.32.95 66.135.34.8 66.135.35.75 69.44.57.12 69.44.57.230 69.44.57.78 69.44.57.98 69.44.58.95 80.88.132.177 80.88.142.6 80.179.101.199 80.179.101.206 80.179.104.110 80.230.180.153 81.199.84.4 81.199.84.66 81.23.204.210 192.116.85.31 192.116.134.100 195.166.233.221 200.164.24.92 209.179.198.70 210.180.96.43 213.255.195.5 216.138.217.106 216.139.176.82 216.205.75.23 216.205.75.24 216.205.75.25 216.205.75.26 216.205.75.27 216.205.75.28 216.205.91.228 216.205.91.229 216.205.91.230 216.205.94.82 216.205.94.83 216.205.94.84 216.205.94.85 216.205.94.87 216.205.94.88 216.205.94.89 216.205.94.90 216.250.221.9 217.73.164.106 217.78.73.200 217.136.110.146 217.20.242.103 217.44.102.197 217.211.215.100

Added Oct 25

217.194.153.76

Added Oct 11

216.205.94.85 216.205.94.87 211.161.24.38 213.185.113.21 216.205.75.26 216.205.91.230 218.116.134.67 65.26.251.81 69.44.57.12 69.44.57.230 69.44.57.78 69.44.58.95 80.179.101.206 81.199.84.54 200.207.88.30

Added Oct 10

195.137.116.147 66.135.32.95 211.99.203.196 216.205.94.90 218.32.136.169 24.123.125.205 24.63.10.222 62.194.119.210 65.26.251.81 66.135.32.95 66.135.34.8 66.135.35.75 69.44.57.12 69.44.57.230 69.44.57.78 69.44.58.95 80.58.0.44 80.58.3.172 81.130.247.170 81.199.6.58 81.199.6.5 81.199.84.66 67.33.165.219 24.201.23.191 200.140.20.130 65.26.251.81 66.21.129.90

Added Oct 3

209.235.23.70 210.192.120.74 213.185.113.21 216.148.246.134 216.205.75.23 216.205.75.24 216.205.75.25 216.205.75.26 216.205.75.27 216.205.75.28 216.205.91.228 216.205.91.229 216.205.91.230 216.205.94.82 216.205.94.83 216.205.94.84 216.205.94.85 216.205.94.87 216.205.94.88 216.205.94.89 216.205.94.90 217.20.241.2 220.113.170.199 24.63.10.222 62.194.119.210 65.26.251.81 80.58.13.44 216.148.246.134 65.26.251.81 81.192.2.118 81.23.97.150 65.80.28.112

Added Sept 25

203.134.81.145 216.205.91.230 216.205.94.82 216.205.94.83 216.205.94.87 216.205.94.88 216.205.94.89 216.205.94.90 216.29.3.217 24.74.55.217

Added Sept 20

211.157.36.3

added Sept 19

211.157.36.7 217.136.110.146 81.199.84.56 68.168.3.122

added Sept 18

210.56.12.18 80.247.152.5 216.29.3.217

added Sept 14

24.74.55.217

added Sept 11

203.220.183.105

added Sept 9

80.179.100.214 24.74.55.217 67.161.26.63

added Sept 7

205.188.208.166

added August 14

24.48.254.59 200.30.138.4

added August 4

195.229.241.235

added August 2

218.109.130.136

added August 1

218.109.130.136

added July 31

81.199.83.116 192.116.98.6 218.109.130.136

added July 27

12.164.52.41

added July 26

81.199.84.81

added July 25

81.23.97.150

added July 17

80.88.129.28

added July 16

211.157.36.7

added July 12

24.71.66.141 212.199.239.161 80.247.141.137 24.63.10.222 24.71.66.141 207.139.99.155 67.120.29.86 219.94.63.6 24.63.10.222 80.247.141.137 218.17.61.56

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

metulj Super moderator Principal · 1,726 posts #2

wow nice External image (may be gone)

one question here...

can we also ban specified browser in .htaccess ?

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

alesh Lead · 604 posts #3

hmmmm well explained butit still didnt get 2 my lil brain lol

this is how i get it

php_value register_globals 1
# block visitors referred from indicated domains
RewriteEngine on
RewriteCond %{HTTP_REFERER} offendingdomain1\.com [NC,OR]
RewriteCond %{HTTP_REFERER} offendingdomain2\.com [NC,OR]
RewriteRule .* - [F]

or also like this

php_value register_globals 1
# deny all except those indicated here
<Files *>
order deny,allow
deny from all
deny from 12.345.67.890   <-----my choise of ip addres?
deny from .*domain\.com.*  <---- my choise of domain
</Files>

so if i enter 2wap.org, no1 from 2wap.org cn come 2 my site or what???? i dnt understand tht .domain.com. part????

im sorry if my question is stupid and my choise of 2wap.org is just an egsample.......

btw metulj u cn easily block browsers by making php file

eeeeerrr....

WhiteWarrior Principal · 1,419 posts #4

it means people cant click a link to your site from here i think

alesh Lead · 604 posts #5

it means people cant click a link to your site from here i think

u sure or u just thnk????????

eeeeerrr....

Guest #6

how about blockin a specified country ip?

amylee Principal · 1,092 posts #7

how about blockin a specified country ip?

just ban the ip range or something like this deny from 123.255. that would ban anyone with a ip like 123.255.xx.xx from accessing your site but thats not wise to do

metulj Super moderator Principal · 1,726 posts #8

just ban the ip range or something like this deny from 123.255. that would ban anyone with a ip like 123.255.xx.xx from accessing your site but thats not wise to do

will record 123.255.xx.xx (as stated above) actually work External image (may be gone)

i think it should be written 123.255.. (in fact, even 123.255.* should be enough) External image (may be gone)

if im wrong, feel free to corect me External image (may be gone)

but then again... imho it's easyer to find out all domains from one country than all IP ranges.. so simple check all ISP's from desired country and add their domains External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Regz #9

Hmmm very Nice Tips wud reply more after trying out thnx a lot

XXX #10

hmm...interesting..if only i could get this idea around my head...like how to block sum countrys from entering a site on different scripts....

amylee Principal · 1,092 posts #11

thats easy just ban summat like 196.207.45.00/255 to ban like all of south africas mobile networks for example

XXX #12

hmm...interesting..if only i could get this idea around my head...like how to block sum countrys from entering a site on different scripts....

different scripts....

Guest #13

LoL ... thnx for interesting info ! i will use this on my web and wap pages and portals !

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close