0

I have a website and it has an audio player to play music files. The music files are hosted in a public directory. Since they are there anyome can point there and use the files on their website.

Is there a way to only allow my webpages to use the audio tracks?

Anders
  • 64,406
  • 24
  • 178
  • 215
  • Please add the OS and the http server you are working on. Fix your title: it is internal access you aim to control. – dan Jul 23 '14 at 06:39
  • I am not sure of the OS as I have not made the website go live yet. Most likely it is going to be Apache. – user3647798 Jul 23 '14 at 11:24

1 Answers1

1

The files are public for the users' browsers to be able to play them, so you cannot prevent users downloading them for other reasons (or indeed just saving the copy in their browser cache).

If you want to stop people reusing them in-place from your website (which might be your main aim - someone else referring to the file on your site causes you server load and bandwidth use), you can add a check on the HTTP referrer field. See for instance http://www.htaccess-guide.com/deny-visitors-by-referrer/ .

Colin Phipps
  • 146
  • 3