TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

.htaccess file password problem

Page: 1 Reply
Feb 13th 2004#142029 Report
Member since: Nov 13th 2003
Posts: 41
I need to know how to set the .htaccess file up so whenever someone tries to download a file it asks for a username and password. So far I've only succeded in locking down a directory and not the files.

Now the real problem is this:

- Folder with files.
- index.php <- this file lists all of the files in the directory.
- Download 1
- Download 2

So I don't know if it's possible to lock down the files and not the dir. :confused:
Reply with Quote Reply
Feb 13th 2004#142032 Report
Member since: Dec 9th 2003
Posts: 180
[QUOTE='[NoFear]']I need to know how to set the .htaccess file up so whenever someone tries to download a file it asks for a username and password. So far I've only succeded in locking down a directory and not the files.

Now the real problem is this:

- Folder with files.
- index.php <- this file lists all of the files in the directory.
- Download 1
- Download 2

So I don't know if it's possible to lock down the files and not the dir. :confused:[/QUOTE]

as far as i know htaccess works on a "per directory" basis and not "per file", so if you want to protect your files do something like this:

/downloads/index.php <--- your downoload page that links to files in "/files"
/files/.htaccess <-- your .htaccess file that locks down your "/files" directory and all the files in it.
/files/file1.zip
/files/file2.zip
/files/file3.zip


hope that helps
Reply with Quote Reply
Feb 13th 2004#142042 Report
Member since: Nov 13th 2003
Posts: 41
thing is there can be several 100 files and I don't want to link all those, it'll take ages so I've made an automatic listing script that looks at bit like the open dir. but if I can make it list a sub dir and not the dir it's in then perhaps it's possible.
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum