Home » Htaccess Tools » Questions regarding htaccess » Two ways to block bad referrers?
Two ways to block bad referrers? [message #506] Wed, 26 July 2006 22:55 Go to next message
Dred
Messages: 2
Registered: July 2006
First i'd like to say hello everyone that views this post, i'm newly registered, but been lurking some time. Very Happy

Now for my subject question:
I've seen two ways to block bad referrers. Could someone please tell me which way is the right way?

here's one:
RewriteCond %{HTTP_REFERER} example\.com [NC,OR]


and here's the other:

RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?http://www.example.com.*$ [NC,OR]


I found these while looking for someway to block and/or redirect hits from certain sites as well as hitbots...namely sites that are on my blacklist, but i'm confused as to which one is correct.

Does each code block something different?

tia Smile
Two ways to block bad referrers? [message #507] Wed, 26 July 2006 23:26 Go to previous messageGo to next message
Dred
Messages: 2
Registered: July 2006
nm...i found this:

Block site from specific referrers

RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]


Block Hot Linking/Bandwidth hogging

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
Two ways to block bad referrers? [message #511] Sun, 30 July 2006 16:53 Go to previous message
andreas  is currently offline andreas
Messages: 239
Registered: January 2005
Location: Denmark

Site Admin
Yes, that is the correct codes to use.
Previous Topic:A challenge: Changing _ to -
Next Topic:javascript in .htaccess
Goto Forum:
  


Current Time: Sat May 17 07:42:17 CEST 2008

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software