Web Hosting Talk







View Full Version : help with a direct link downloads


Daniel B
11-08-2005, 08:15 PM
I have a client who would like a site that is set up like this:

splashpage with just an image and title

a page for him to upload/download all his files and only he can see this page.

a way to make it so that the files can only be dowloaded if the person who is downloading uses the exact link to the file, and ONLY the exact link, no other way should allow a download.

i am still learning website building and am currently only in the standard html stuff, so this is beyond me ATM, but i would really like to know how this is done...any help will be greatly appreciated.

(before anyone asks why i have a client that wants this and i'm not set up to handle it...it is becuase i usually only offer hosting...but this client is also a friend of mine and i said i would see what i could do for him webiste wise)

dollar
11-08-2005, 08:21 PM
Odds are you are already setup for this...

Have him upload the splash page as index.html
he can create a folder (any folder he wants, maybe myhotfiles is the name of it), and store all of his files there. Even if somebody goes to http://site.com/myhotfolder/ they most likely will not be able to browse the directory.

If they can just put in a .htaccess file with:

IndexIgnore */*

If you are worried about hotlinking, add this: (assuming that you support mod_rewrite)

be sure to edit the file types, gif, jpg, and mpg are in there right now and change domain.com to the domain name.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com/.*$ [NC]
RewriteRule .(gif|jpg|mpg)$ - [F]