I recently noticed some people complaining about music blogs which link directly to mp3s hosted on other music blogs. These music bloggers have gone so far as to remove their mp3 links from their syndication feed in order to stop people linking to their mp3s. Muruch writes

The more popular blogs may be willing to spare their bandwidth in return for the publicity, but for smaller legal blogs like mine it’s just not worth it.

I don’t see how not including your mp3s in your RSS or ATOM feed is stopping anybody from linking to them, but I can empathize with the bandwidth issue and was even a little perplexed about how to address this issue. Thankfully, Lucas was able to set me straight. Standards already exist which allow bloggers to control how web surfers can access their mp3 content, which can effectively stop people from hotlinking to your mp3s if it’s causing you grief. There’s really no reason for anybody to get cranky about it… Here’s how it works:

Direct link from my site works fine

http://musiclibre.org/music/wms/WMS-4_Woolly_Mad_Star_D2.mp3

But if you try to link to it from your site - not so much…

Example third party site copying this link

Here’s the code to get it working for yourself:

Copy the following text into your favourite text editor, replacing yoursite.com with your own domain name.
Save it as filename “.htaccess” and upload it to the directory where you keep your mp3s.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://yoursite.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com.*$ [NC]
ReWriteRule .*\.(mp3)$ - [F]

Popularity: 60% [?]