|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Referrer information with embedded media player
Hi,
I’m currently using an embedded Windows Media Player on my website so that the users can listen to some sound samples. What I’ve been trying to do is to restrict access to the sound samples, so that they are accessible only from my webpages. I though that would be easy, using htaccess or through the automated process in my cpanel (the sound samples are on a linux machine). However, it seems that the issue is much more complicated that I thought. This is due to the fact that it seems that the embedded player does not send any referrer information. Thus, whatever I put in my htacecss file becames useless. I have to allow requests from visits with no referrers, thus everybody who knows the URL of the files can simple write it to his browser and download the file - they can even link to my sound files from their website!! Is there a way to restrict access to my music? I guess the only way to do that would be to embed the Windows Media Player in a way that it sends referrer information. Is that possible? cheers n. |
|
#2
|
||||
|
||||
|
the referrer
Hi billgates200, welcome to the forums,
The player may not send a referer. And http referer isn't fool-proof (eg. in Opera you can disable referer tracking), but the page that calls the files should usually send a referer header. Try adding this to the folder's htaccess Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !http://www.your_domain.com/calling_page.php [NC]
RewriteRule .*\.file_extension$ - [F]
Or, if you have PHP, you can have the calling page set a SESSION var, and link to PHP files that test for the var, use header(Content-type: xxxx) to output the media, and use the file functions to get the media file contents. I imagine there would be someting similar for other server-side scripting languages too. IMHO this technique would work better than htaccess. Last edited by Mittineague : July 4th, 2006 at 12:06 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Advanced Web Development > Referrer information with embedded media player |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|