Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

htaccess to block a wildcard domain

6:26 pm on Aug 16, 2006 (gmt 0)

New User

10+ Year Member

joined:July 19, 2006
votes: 0

I run a small community site (nuked) and I've noticed over time when looking at my referrals in my site stats that I have a tons of these listed:

Links from an external page (other web sites except search engines):

[www....] .. poker .. .com

(meaning that all these sites have POKER in their referral name.)

There is no content from these on the site. The site I run has nothing to do with these. I understand that it's a bot and spam of some sort but I'm not sure if I should worry about it or just ignore them or whatever.

The thing is that there are so many of them I'm sure it's sucking down server cycles if they're actually on the site crawling and it sure makes it a read to figure out real external links from bogus ones.

I have searched this site as requested but although it seems like .htaccess is my best bet, I'm not sure how I should use it properly to block these sites.

In short, via .htaccess, I wish to block any spider/bot which uses "poker" in it's referral name.

I have rewrite on, etc.

My thoughts, based on my searching and searching and still being an .htaccess n00b are to include the following in .htaccess:

RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*poker.*\.com/.*$ [NC] 
RewriteRule ^.*$ - [F,L]

But I'm not sure if this is correct or if I should go about it in a different way.

So any light you could have or suggestions for me would be greatly appreciated!


6:35 pm on Aug 16, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 12, 2004
votes: 0

I use the following instead of RewriteCond:

SetEnvIfNoCase Referer blackjack spammer=yes
SetEnvIfNoCase Referer poker spammer=yes
deny from env=spammer

It's very effective dealing especially with referers.