Link to home
Start Free TrialLog in
Avatar of devoleb
devolebFlag for United States of America

asked on

How do I display contents of web directory? Explorer-like


I have a simple website that I tend to use to host small files I may need later on.  Attached is index.php, which is a little password protection script I found via Google.  It does the trick, but has its annoyances.

I would like to be able to go to www.mydomain.com/files , type in a password, then have the files listed something like this directory does:  http://devbuilds.kaspersky-labs.com/devbuilds/RescueDisk/

Or even an explorer-like display, but I don't care to get into huge plugins or services.  I've heard that ".htaccess" can help me do this, but I'm not quite sure what to do with that.

My provider is GoDaddy with their Linux server package.  


Thanks for any help!
Avatar of Chocco
Chocco
Flag of Australia image

If you set up FTP access on your site, copy the files to the server, and then referr people to;

ftp.mydomain.com/files

you can then use the .htaccess file to control access..

A good complete guide for setting up an .htaccess file is below;

http://www.thesitewizard.com/apache/password-protect-directory.shtml
ASKER CERTIFIED SOLUTION
Avatar of Vygandasj
Vygandasj
Flag of Lithuania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of devoleb

ASKER

Thanks for the replies!

Chocco, while I agree this would be the simplest method, I would like to keep it under one protocol.  I'm unsure of everyone else's browers, firewalls, passive modes/etc.  So I went the .htaccess way minus FTP.

I had been reading about .htaccess, but had never heard of the Indexes option.  Thanks for the valuable info, Vyg.

For any GoDaddy web hosting users that are trying to achieve something like this, here is my .htaccess:


Options +Indexes
AuthName "Secure Area"
AuthType Basic
AuthUserFile /home/content/##/#######/html/.htpasswd
require valid-user



Create .htpasswd with "htpasswd -c .htpasswd your-user-name"

I then created the .htpasswd file in my root FTP directory, which is the servers' "html" directory.  All works as I need it.  You go to the website, enter username/pass, and are then presented with a list of contents in an easy-to-read format with file sizes and everything.

Thanks again