icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Choosing Surpass » Signed Up? » .htaccess and password protecting directories NOT files

Signed Up? If you're new with a question, ask here!

Reply
 
LinkBack Thread Tools Search this Thread
Old August 4th, 2007, 1:45 AM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Apr 2006
1 posts
Gave thanks: 0
Thanked 0 times
.htaccess and password protecting directories NOT files

Hello. I have looked around but haven't been able to find help for this particular quesiton on this forum nor the internet in general. I assume maybe it can be done messing with httpd.conf, but I don't even know how to access that.

I would like to put a password on a folder, so that when I enter the password, I am able to view the contents of the folder (there is no index.html). But, I dont want the password to interfere with the files in the folder.

e.g. if i go to

http://www.site.com/folder

i will be prompted to enter a user/password in order to view all the files in this folder. HOWEVER, if i simply type in:

http://www.site.com/folder/image.jpg

in my browser, I can view this file, no problem, without having to enter a password.

A friend suggested to put a password on the folder, but then put an exclusion for .jpg, .gif files in the httpd.conf file, but that is beyond me. Any help would be appreciated!
typogra is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 6th, 2007, 8:21 AM   #2 (permalink)
Surpass Fan
Comfy Contributor
 
davotoula's Avatar
 
Joined in Oct 2004
148 posts
Gave thanks: 2
Thanked 2 times
Another way would be to solve it with PHP.

1. When user enters folder (index.php), it says password protected folder, please enter password.

2. If password is correct, a list of files is shown and the files can be accessed without restriction.

The overall security is a bit questionable because if the URL of a file is leaked (beware of google), there is no access control to it!
__________________
David Kaspar | SH60
davotoula is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On