Forum Moderators: phranque

Message Too Old, No Replies

how do I make this simple .htaccess file to allow directory viewing

         

gaidensensei

8:41 pm on May 15, 2005 (gmt 0)

10+ Year Member



Hi,

I've been checking out the net for a long time the last few days on how to make a simple .htaccess file to do something, but I keep getting errors.

I want to display a www/image/ folder, but only if that person fills in a password.

What is the exact line word-for-word that I need to write in the .htaccess file?

I've found that
Options +Indexes
allows for the /image/ folder to be displayed.

But how/what code do I add a user name and password? Say for example, joebob and password 123

My server defaults all folders to be hidden.

TIA

gaidensensei

9:27 pm on May 15, 2005 (gmt 0)

10+ Year Member



I forgot to mention that I would like the images inside the folder to be publicly viewable, EG

Ebay links image to, and no password is needed to view:
\image\blah\blah.jpg

But I don't want them to be able to browse the whole folder., such as
\image\*.*

I wrote this:
===========
AuthUserFile /mypathto/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic

require user joebob
===========

but if I put that in the .htaccess, it requires everyone on ebay to enter the password to be able to view it!

sitz

10:34 pm on May 15, 2005 (gmt 0)

10+ Year Member



Check out this thread [webmasterworld.com]; sounds like what you're trying to do.