Forum Moderators: phranque

Message Too Old, No Replies

httaccess question

         

Lord_Methos

11:57 am on May 21, 2006 (gmt 0)

10+ Year Member



my site hosts lots of video files and i'm tryin to make a .htaccess file to prevent hotlinking yet allow users to use download managers.
so far i managed to create a scrip that blocks all downloads .

RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://([-a-z0-9]+\.)?domain\.com [NC]
RewriteRule \.(avi¦mkv¦ogm)$ - [F,NC,L]

also i'm tryin to make that every user can download using only a number of connections to the server...i have no idea how to do that :¦

jdMorgan

2:33 pm on May 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most media players and many download accelerators do not provide a referrer, so this approach is unlikley to work.

I think you'll really need a script to manage downloads using a 'user-session-aware' approach, i.e. tag the user with a cookie so you can identify any given user no matter how many requests he/she tries to open. I'm not sure you can even do that -- It depends on whether media players and download accelerators will accept and return cookies. An alternate would be to give each user a unigue query string or URL for session management purposes.

mod_rewrite is not a powerful scripting language, and it's limitations show here.

Jim

Lord_Methos

4:05 am on May 26, 2006 (gmt 0)

10+ Year Member



hmm...
could you please direct me to how i can do that?
please