Forum Moderators: phranque

Message Too Old, No Replies

Rewrite rule to prevent download

Prevent MP3 file download

         

askbehera

4:38 am on Sep 23, 2007 (gmt 0)

10+ Year Member



Can anybody help me how to prevent the mp3 download from website.
or
can anybody help, only I can listen the mp3 rather download, means download should not allowed.

[mydomain.com...]
I want to prevent my.mp3 direct download, in fact requester can listen to my.mp3 online but should not allow to download.

please suggest how to go about that.

my rule seems as below.

<Location />
RewriteEngine on
RewriteCond %{REQUEST_URI} mymp3folder/my\.mp3$ [NC]
RewriteCond %{HTTP_REFERER} ^$ [OR]
RewriteCond %{HTTP_REFERER} !mydomain.com/mymp3folder.*$ [NC]
RewriteRule (.*) [mydomain.com...] [R,NC,L]

vincevincevince

4:52 am on Sep 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm afraid you cannot do that. The closest you can get is to stop them copying and pasting the URL to a downloading client or linking from their own site - which seems to be what you're trying to do there.

Someone right-clicking and selecting Save Link As... is seen by your server identically as someone left-clicking and the music playing.

The only real way to secure your MP3 is to use a Flash player or similar which will obscure the URL entirely.