View Full Version : Experienced user but this .httaccess problem is beyond me.

06-11-2010, 01:00 PM
Hiya i have a weird problem which i just cannot explain below is the code.
What is happen is if i go to www.domain.com/customercare/secretfolder i get the password dialog
which is great enter the right user/pass i get access to the dir.

if i add a single / at the end of secretfolder i get instant access to the same dir and i can freely open up any html pages it
seems as soon as i put a / at the end of the secretfolder it just opens it wide up bypassing the .htaccess completely.

Now when i try the same example on the DEMO page at dynamic drive i try adding a / at the end of example and low and behold
your version gives me the popup user/pass dialog box regardless below is the code i have.

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/home/.htpasswd
AuthGroupFile /dev/null
require valid-user

here is the .htaccess file protecting the directory.

/var/www/home/customercare/secretfolder/ [.htaccess file is this dir]

whats going wrong???

After i get this weird glitch fixed if anyone can fix it my main goal is this.

I would like to be-able to lock that secretfolder at the DIR level so regardless if people put secretfolder or secretfolder/
they would still get the dialog password box.. BUT if you went to for instance domain.com/customercare/secretfolder/customer1/id.html
i.e. if you knew the exact location of the file you wanted to access it would bypass the login password box...

in other-words i want to be-able to have straight access to files i know exactly their locations but i don't want people to be-able
to view all files listed in this directory from going to domain.com/customercare/secretfolder/

is this at all possible if so can someone write me the script please.
if you need file names everything i would like to be-able to access if i knew exactly the file names and locations beyond that dir are all .html files.