homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

htaccess to block a wildcard domain

5+ Year Member

Msg#: 3048850 posted 6:26 pm on Aug 16, 2006 (gmt 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!




10+ Year Member

Msg#: 3048850 posted 6:35 pm on Aug 16, 2006 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved