Forum Moderators: phranque

Message Too Old, No Replies

.htaccess on site folders

can I pass protect a folder with pictures in it?

         

djui5

9:42 am on Nov 28, 2004 (gmt 0)

10+ Year Member



I'm trying to password protect my sites main images folder.....but I still need the pictures to diplay in the web-pages...

I set up a .htaccess file..but it asks for a user/pass when I try to load the page through firefox...

Can you do this?

djui5

6:01 am on Dec 1, 2004 (gmt 0)

10+ Year Member



? Anyone?

I'm new....so hello everyone.....this is my second post :)

jdMorgan

3:34 pm on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



djui5,

Welcome to WebmasterWorld!

If you want the pictures to be accessible via HTTP without entering a password, then you can't password-protect them.

However, you could create a server-side acript to serve those pictures from a Web-protected directory. Since the script will access the pictures using server filesystem requests instead of HTTP requests, you can put the pictures in a directory that is inaccessible from the Web.

I'd suggest PHP or PERL for this application.

I haven't done this myself, so that's the most I can offer on the subject.

Jim

djui5

1:25 am on Dec 2, 2004 (gmt 0)

10+ Year Member



wow..thanks Jim...I'll look into it further :)