Tilt - 12 track CD of Scottish Techno

Archive for the 'Web' Category

No Flash audio in OS X Tiger

Monday, March 13th, 2006

My mac recently stopped playing Flash audio - not only in Safari but also in Firefox. This was rather frustrating due to the number of sites that now use Flash for tune previews. After a bit of reading today I discovered that the cause may have been installing Audacity and the solution bizarrly was to run Apple’s Garageband software once. This actually worked! Don’t let this put you off trying Audacity - this small issue aside it’s a great free audio editor.

Preventing offsite linking to audio files

Sunday, February 12th, 2006

When running a music site there is nothing more annoying than 3rd party web sites hotlinking your mp3s - particularly where dj mixes are concerned. This uses valuable bandwidth without the downloader ever having visited you site, read your forum or registered as a user. Fortunately it is quite simple to prevent with the use of a little file called .htaccess (note the preceeding dot).

Requirements

You will need to be running an apache web server with the mod_rewrite module loaded. If you are not sure whether or not this is the case save the following line to a text file called phpinfo.php:-

< ? phpinfo(); ?>

Upload this file to your web server and then load it into your browser eg http://www.yoursite.com/phpinfo.php. Fairly close to the top of the page you should find a section called either apache or apache2handler. At the bottom of this section is the loaded modules - mod_rewrite should be one of the values to the right.

Excerpt from phpinfo showing mod_rewrite

The .htaccess file

The next stage is to create the .htaccess file. Once again create a new text file and insert the following:-


RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite.com/ [NC]
RewriteRule [^/]+.(mp3|MP3)$ http://www.yoursite.com [R,L]

Replace yoursite.com with your domain name in lines 3 & 4. Line 3 details the domain that is allowed to download the files - if you wish more than one domain to have access to them simply duplicate this line. Line 4 redirects people to your homepage if they click on a link to one of your mp3s from another site. Save this file as .htaccess and upload it to your mp3 folder on your website. And that’s it!

Use of this is of course not just limited to mp3 files - it can be used to prevent leeching of images for instance by changing the file type in the RewriteRule on line 4.

Downtime

Thursday, November 24th, 2005

The BSE site has been down for a few days due to server trouble. Back up now and all the mp3s have been re-uploaded.

PS. I have loads of gmail invites to give away if anyone is looking for one. Drop me an email.

Hi Web Tech

Tuesday, October 25th, 2005

I’ve finally got myself a blog which I’m going to try not leave to gather dust. I’ve also signed up for an a flickr account and a del.icio.us account to get a feel for all these fancy new web apps - maybe even finally get myself semi-organised…

I’ve also downloaded the new Flock web browser. It’s built on Firefox technology but is designed to integrate with all these new tools such as flickr, wordpress etc.

Links:-
Wordpress (blogging tool)
del.icio.us (online bookmarks)
Flock (web browser)
flickr (photo album)