<p>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 <a href="http://www.dizzler.com" rel="nofollow noreferrer">http://www.dizzler.com</a> which is a flash based site that allows you to browse a library of crawled publicly available mp3s.</p>

<p><strong>Edit:</strong> 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</p>

[{'answer_id': 81247, 'author': 'perimosocordiae', 'author_id': 10601, 'author_profile': 'https://Stackoverflow.com/users/10601', 'pm_score': 0, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 81250, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 2, 'selected': False, 'text': '<p>From <a href="http://www.javascriptkit.com/howto/htaccess14.shtml" rel="nofollow noreferrer">this site</a>: (put this in your .htaccess file)</p>\n\n<pre><code>RewriteEngine on\nRewriteCond %{HTTP_REFERER} ^http://((www\\.)?dizzler\\.com [NC]\nRewriteRule .* - [F]\n</code></pre>\n'}, {'answer_id': 81269, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>You could use something like</p>\n\n<pre><code>SetEnvIfNoCase Referer dizzler.com spammer=yes\n\nOrder allow,deny\nallow from all\ndeny from env=spammer\n</code></pre>\n\n<p>Source: <a href="http://codex.wordpress.org/Combating_Comment_Spam/Denying_Access" rel="nofollow noreferrer">http://codex.wordpress.org/Combating_Comment_Spam/Denying_Access</a></p>\n'}, {'answer_id': 81290, 'author': 'matt lohkamp', 'author_id': 14026, 'author_profile': 'https://Stackoverflow.com/users/14026', 'pm_score': 3, 'selected': True, 'text': '<p>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.</p>\n\n<p>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 : <a href="http://www.evolt.org/article/Using_Apache_to_stop_bad_robots/18/15126/" rel="nofollow noreferrer">Using Apache to stop bad robots</a> [evolt.org]</p>\n\n<p>If you want an easy way to stop dizzler in particular using the .htaccess, you should be able to pop it open and add:</p>\n\n<pre><code>&lt;Directory /directoryName/subDirectory&gt;\nOrder Allow,Deny\nAllow from all\nDeny from 66.232.150.219\n&lt;/Directory&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/81238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/327/']