.htaccess and spam

Spammers suck. They really, really suck.This is just one little tidbit on how to stop them from sucking on your site, and go elsewhere.

You know, while I sit here, working on a new theme to put up on the site so people can download it, and waiting for my hair to dry, I just remembered one of the best things I have to offer people.

My .htaccess file.

I’ve developed my .htaccess file over the last few years, and haven’t had to touch it in about 2 years, because it’s so effective in controlling spam. I won’t confirm the types of spam it controls, because I’ve also had other methods in place – but one thing I do know is that it controls referer spam.

For those of you that don’t know, here is the Wiki on referer spam:

Referer spam is a kind of spamdexing (spamming aimed at search engines). The technique involves making repeated web site requests using a fake referer url pointing to a spam-advertised site. Sites that publicize their access logs, including referer statistics, will then also link to the spammer’s site.

This benefits the spammer because of the free link, and also gives the spammer’s site improved search engine link placement due to link-counting algorithms that search engines use.”

In other words, the lazy jerks ride your tails, and most likely, you don’t even know they’re doing it. If you want to see, go log into your host’s cPanel (or whatever you use) and check your web stats for referers. Betcha there’s a bunch of sites that “refer” to you, with names associated with pharmaceuticals, porn, celebrities, and poker, among other things.

I got so sick and tired of seeing this stuff in my logs…I could never see who was actually linking to me and get correct stats. So, I began working on an .htaccess file to elimate the problem.

I won’t promise this – but I’ve also noticed my comment spam has been reduced by a lot on my blogs. However, my personal blog actually utlizes Moveable Type (not WordPress, like this one), and I’ve found the MT Blacklist to be something I can’t live without – and I’m quite sure that the MT Blacklist had a large helping hand in working with the .htaccess file in getting my spam reduced to almost nothing.

That all being said, I’m willing to share my .htaccess file with you. So, without further ado…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
AddType text/html .shtml .shtm .htm .html
AddHandler server-parsed .shtml .shtm .htm .html
ErrorDocument 401 http://YOUR URL HERE/error/unauthorized.html
ErrorDocument 403 http://YOUR URL HERE/error/forbidden.html
ErrorDocument 404 http://YOUR URL HERE/error/unknown.html
ErrorDocument 505 http://YOUR URL HERE/error/server.html
Options -Indexes
Options +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_REFERER} ^http://(www\.)?iconsurf\.com/ [NC]
RewriteRule \.(ico)$ - [F]
RewriteCond %{HTTP_REFERER} !.*YOUR URL\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !.*YOUR SECONDARY URL\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)google\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)altavista\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)yahoo\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)msn\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)a9\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)lycos\..*$ [NC]
RewriteCond %{REQUEST_URI} !/403.shtml$ [NC]
RewriteCond %{HTTP_REFERER} advair [OR]
RewriteCond %{HTTP_REFERER} allegra [OR]
RewriteCond %{HTTP_REFERER} ambien [OR]
RewriteCond %{HTTP_REFERER} amoxicillin [OR]
RewriteCond %{HTTP_REFERER} baccarat [OR]
RewriteCond %{HTTP_REFERER} bet [OR]
RewriteCond %{HTTP_REFERER} blackjack [OR]
RewriteCond %{HTTP_REFERER} cash [OR]
RewriteCond %{HTTP_REFERER} casino [OR]
RewriteCond %{HTTP_REFERER} celeb [OR]
RewriteCond %{HTTP_REFERER} cheap [OR]
RewriteCond %{HTTP_REFERER} cialis [OR]
RewriteCond %{HTTP_REFERER} craps [OR]
RewriteCond %{HTTP_REFERER} credit [OR]
RewriteCond %{HTTP_REFERER} deal [OR]
RewriteCond %{HTTP_REFERER} debt [OR]
RewriteCond %{HTTP_REFERER} drug [OR]
RewriteCond %{HTTP_REFERER} effexor [OR]
RewriteCond %{HTTP_REFERER} equity [OR]
RewriteCond %{HTTP_REFERER} faxo [OR]
RewriteCond %{HTTP_REFERER} finance [OR]
RewriteCond %{HTTP_REFERER} gambling [OR]
RewriteCond %{HTTP_REFERER} hold-em [OR]
RewriteCond %{HTTP_REFERER} holdem [OR]
RewriteCond %{HTTP_REFERER} iconsurf [OR]
RewriteCond %{HTTP_REFERER} insurance [OR]
RewriteCond %{HTTP_REFERER} interest [OR]
RewriteCond %{HTTP_REFERER} internetsupervision [OR]
RewriteCond %{HTTP_REFERER} keno [OR]
RewriteCond %{HTTP_REFERER} levitra [OR]
RewriteCond %{HTTP_REFERER} lipitor [OR]
RewriteCond %{HTTP_REFERER} loan [OR]
RewriteCond %{HTTP_REFERER} meds [OR]
RewriteCond %{HTTP_REFERER} money [OR]
RewriteCond %{HTTP_REFERER} mortgage [OR]
RewriteCond %{HTTP_REFERER} omaha [OR]
RewriteCond %{HTTP_REFERER} paxil [OR]
RewriteCond %{HTTP_REFERER} pharmacy [OR]
RewriteCond %{HTTP_REFERER} pharmacies [OR]
RewriteCond %{HTTP_REFERER} phentermine [OR]
RewriteCond %{HTTP_REFERER} pheromone [OR]
RewriteCond %{HTTP_REFERER} pills [OR]
RewriteCond %{HTTP_REFERER} poker [OR]
RewriteCond %{HTTP_REFERER} refinance [OR]
RewriteCond %{HTTP_REFERER} roulette [OR]
RewriteCond %{HTTP_REFERER} scout [OR]
RewriteCond %{HTTP_REFERER} seventwentyfour [OR]
RewriteCond %{HTTP_REFERER} slot [OR]
RewriteCond %{HTTP_REFERER} syntryx [OR]
RewriteCond %{HTTP_REFERER} texas [OR]
RewriteCond %{HTTP_REFERER} tournament [OR]
RewriteCond %{HTTP_REFERER} tramadol [OR]
RewriteCond %{HTTP_REFERER} tramidol [OR]
RewriteCond %{HTTP_REFERER} valtrex [OR]
RewriteCond %{HTTP_REFERER} viagra [OR]
RewriteCond %{HTTP_REFERER} vicodin [OR]
RewriteCond %{HTTP_REFERER} win [OR]
RewriteCond %{HTTP_REFERER} xanax [OR]
RewriteCond %{HTTP_REFERER} zanax [OR]
RewriteCond %{HTTP_REFERER} zoloft [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?adult(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?anal(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?blow.?job(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?gay(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?incest(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?mature(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?nude(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?porn(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?pus*y(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?sex(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?teen(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?tits(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?titten(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?38ha(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?4free(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?4hs8(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?4t(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?4u(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?6q(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?8gold(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?911(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?abalone(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?adminshop(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?adultactioncam(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?aizzo(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?alexa(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?alphacarolinas(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?amateur(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?amateurxpass(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ansar-u-deen(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?atelebanon(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?beastiality(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?bestiality(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?belize(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?best-deals(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?blogincome(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?bontril(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?bruce-holdeman(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?vixen1(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ca-america(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?chatt-net(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?commerce(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?condo(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?conjuratia(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?consolidate(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?coswap(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?crescentarian(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?crepesuzette(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?dating(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?devaddict(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?discount(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?domainsatcost(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?doobu(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?e-site(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?egygift(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?empathica(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?empirepoker(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?e-poker-2005(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?escal8(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?eurip(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?exitq(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?eyemagination(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fastcrawl(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fearcrow(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ferretsoft(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fick(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?finance(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?flafeber(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fidelityfunding(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?freakycheats(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?freeality(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fuck(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?future-2000(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?gabriola(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?gallerylisting(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?gb.com(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?globusy(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?golf-e-course(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?gospelcom(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?gradfinder(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?hasfun(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?herbal(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?hermosa(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?highprofitclub(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?hilton(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?teaminspection(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?hotel(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?houseofseven(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?hurricane(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?iaea(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ime(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?info(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ingyensms(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?inkjet-toner(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?isacommie(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?istarthere(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?it.tt(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?italiancharms(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?iwantu(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?jfcadvocacy(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?jmhic(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?juris(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?kylos(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?laser-eye(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?leathertree(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?lillystar(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?linkerdome(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?livenet(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?low-limit(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?lowest-price(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?macsurfer(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?mall.uk(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?maloylawn(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?marketing(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?mcdortaklar(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?mediavisor(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?medications(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?mirror.sytes(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?mp3(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?(-|.)musicbox1(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?naked(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?netdisaster(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?netfirms(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?newtruths(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?no-limit(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?nude(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?nudeceleb(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?nutzu(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?odge(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?oiline(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?onlinegamingassoc(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?outpersonals(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?pagetwo(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?paris(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?passions(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?peblog(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?peng(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?perfume-cologne(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?personal(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?php-soft(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?pics(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?pisoc(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?pisx(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?popwow(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?porn(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?prescriptions(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?printdirectforless(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ps2cool(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?psnarones(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?psxtreme(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?quality-traffic(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?registrarprice(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?reliableresults(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?rimpim(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ro7kalbe(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?rohkalby(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ronnieazza(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?rulo.biz(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?s5(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?samiuls(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?searchedu(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?seventwentyfour(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?seventwentyfour.*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sex(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sexsearch(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sexsq(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?shoesdiscount(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?site-4u(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?site5(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?slatersdvds(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sml338(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sms(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?smsportali(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?software(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sortthemesitesby(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?spears(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?spoodles(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?sportsparent(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?stmaryonline(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?strip(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?suttonjames(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?talk.uk-yankee(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?tecrep-inc(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?teen(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?terashells(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?thatwhichis(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?thorcarlson(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?tmsathai(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?traffixer(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?tranny(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?valeof(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?video(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?vinhas(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?vixen1(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?vpshs(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?vrajitor(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?w3md(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?webdevsquare(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?whois(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?withdrawal(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?worldemail(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?wslp24(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ws-op(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?xopy(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?xxx(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?yelucie(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?youradulthosting(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?(-|.)zindagi(-|.).*$ [NC]
RewriteRule .* - [F]
deny from 217.46.255.241
deny from 65.112.44.225
deny from 64.246.161.26

Copy that sucker and paste it into your .hitaccess file at the root public folder of your server. Of course, you’ll have to make some changes, but this’ll get you going.

Basically, the very first section:

1
2
3
AddType text/html .shtml .shtm .htm .html
AddHandler server-parsed .shtml .shtm .htm .html

..is not necessary. That is there for my websites, so that I can use .shtml includes in my pages. If you have no need for this, then by all means remove it.

This section:

1
2
3
4
5
6
7
ErrorDocument 401 http://YOUR URL HERE/error/unauthorized.html
ErrorDocument 403 http://YOUR URL HERE/error/forbidden.html
ErrorDocument 404 http://YOUR URL HERE/error/unknown.html
ErrorDocument 505 http://YOUR URL HERE/error/server.html

…is for error handling. Rather than use my host/server’s default error pages, these few lines allow me to create custom error pages that follow the themes fo my websites. I get to be as creative as I like, and anytime I want to change it, I simply edit the HTML document and upload in my public_html space on the server.

Again, if you don’t want this, you don’t need it – delete away.

But the real meat of everything is the rest. Pay specific attention to this section:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
RewriteCond %{HTTP_REFERER} !.*YOUR URL\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !.*YOUR SECONDARY URL\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)google\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)altavista\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)yahoo\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)msn\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)a9\..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^/]+)lycos\..*$ [NC]

I have several domain names on my server that I use. I want to be sure that, when someone is actually refered from one of my own websites, that they are included in my stats. So I put in my own domain names to be sure things are free and clear from being considered spam. If you only have one domain, cool. Just put in one and delete the “Your Secondary URL” line. If you have more than two, by all means, copy and add to your heart’s desire.

The rest of the list is allowing search engines to come and index my pages. I don’t want to bar them access, either!

After implementing this .htaccess file, I’ve had my referer spam drop to almost nil. Every now and again, a new thing slips through (some new drug on the market or whatever), and I’ll start getting them again. All I have to do is pay attention to particular words within the domain, and copy one of the “meaty” lines and insert the word as needed.

Wonderful thing, it is. (call me Yoda, if you must.) Hopefully it helps you out, too!

Have your say:

* Copy this password:

* Type or paste password here:

1,812 Spam Comments Blocked so far by Spam Free Wordpress