views:

379

answers:

4

Is there some way to block access from a referrer using a .htaccess file or similar? My bandwidth is being eaten up by people referred from http://www.dizzler.com which is a flash based site that allows you to browse a library of crawled publicly available mp3s.

Edit: Dizzler was still getting in (probably wasn't indicating referrer in all cases) so instead I moved all my mp3s to a new folder, disabled directory browsing, and created a robots.txt file to (hopefully) keep it from being indexed again. Accepted answer changed to reflect futility of my previous attempt :P

A: 

It's not a very elegant solution, but you could block the site's crawler bot, then rename your mp3 files to break the links already on the site.

perimosocordiae
+2  A: 

From this site: (put this in your .htaccess file)

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://((www\.)?dizzler\.com [NC]
RewriteRule .* - [F]
Espo
When I use that and try to visit the folder myself, I get a 500 Internal Server Error.
Luke
What does your error-log tell you about the error?
Espo
+2  A: 

You could use something like

SetEnvIfNoCase Referer dizzler.com spammer=yes

Order allow,deny
allow from all
deny from env=spammer

Source: http://codex.wordpress.org/Combating_Comment_Spam/Denying_Access

Phill Sacre
+3  A: 

That's like saying you want to stop spam-bots from harvesting emails on your publicly visible page - it's very tough to tell the difference between users and bots without forcing your viewers to log in to confirm their identity.

You could use robots.txt to disallow the spiders that actually follow those rules, but that's on their side, not your server's. There's a page that explains how to catch the ones that break the rules and explicitly ban them : Using Apache to stop bad robots [evolt.org]

If you want an easy way to stop dizzler in particular using the .htaccess, you should be able to pop it open and add:

<Directory /directoryName/subDirectory>
Order Allow,Deny
Allow from all
Deny from 66.232.150.219
</Directory>
matt lohkamp
I figure its worth a shot..will report back on whether it helps.
Luke
See edit in question above
Luke