Lancia
11-19-2002, 11:18 PM
Let's say I've got a group of AVI, MPG, and ZIP files in a directory, and I only want users to be able to download them if they are on my website (and not clicking on a link to the file that someone posted on another site). What would be the best way to go about this? I know there's plenty of .htaccess files to prevent this kind of bandwidth theft for images, but I'm not sure how to handle these file types.
Paingasm.net
11-19-2002, 11:41 PM
www.anti-leech.com is a good place to start. (for ideas at the VERY least)
I would look for scrips (asp, php) to handle that. There are dozens out there. :)
ServerCorps
11-20-2002, 12:16 AM
look at the referrer url. If it's not your domain, then they are foreign to you, and probably linked to the file. Secure the directory, and require the stuff be retrieved from a script on your site.
Like: www.winshack.net/getfile.asp?file=sccobydoo.mpeg
when getfile.asp is run, check referrer url. If it's not Winshack.net, then server.transfer then to winshack.net's "please dont steal" page.
PrOsHoCk
11-20-2002, 05:39 PM
HI
Nikko how would i do it if there is no asp..
thanks
ServerCorps
11-20-2002, 05:43 PM
Originally posted by PrOsHoCk
HI
Nikko how would i do it if there is no asp..
thanks
Sorry, I'm strictly a windows/ASP guy, but I'll bet PHP has similar functionality. The anti-leech site referred to earlier might help.
goodness0001
11-20-2002, 05:52 PM
If you are using linux, create a .htaccess file and place it in the root directory of your web site:
#Fill in "mydomain" with your domain name. You can add file extensions
#by adding more in the rewrite rule in the ext|ext|ext| format
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]