fiberse Posted July 11, 2005 Posted July 11, 2005 It sounds simple enough, but I haven't been able to execute it. When someone attempts to access a directory in the domain, instead of finding a permissions error, I'd like authorized users to be able to enter a user name and password to view the contents of that directory. Yet, and here's the big finale, I'd still like the contents of that directory to be viewed as embedded content in pages for those who are NOT authorized. Is something like this possible, or am I dreaming of a happier, simpler time when summer days were long and ice cream sundays were as big as a house... Thanks, Dean Quote
TCH-Don Posted July 11, 2005 Posted July 11, 2005 Welcome to the forum fiberse I know you can protect a directory in cpanel, but without the passowrd, they weill see a not authorized to view this directory. Not sure what you mean by I'd still like the contents of that directory to be viewed as embedded content in pages for those who are NOT authorized. Quote
marie b. Posted July 12, 2005 Posted July 12, 2005 (edited) I think I understand. Say I have PhotoABC.jpg, and it's in folder XYZ that contains photos I'd like to password protect. I add password protection, and that's dandy. What if I want PhotoABC.jpg to appear on my blog without a password prompt or a big red X? Only photograph in the directory that I want to show but it's part of a set or somesuch, so it isn't worth my time creating a new directory just for it alone. I think thats what fiberse wants. Edited July 12, 2005 by marie b. Quote
fiberse Posted July 12, 2005 Author Posted July 12, 2005 Welcome to the forum fiberse I know you can protect a directory in cpanel, but without the passowrd, they weill see a not authorized to view this directory. Not sure what you mean by <{POST_SNAPBACK}> Hello Don, Marie was pretty on-target. In short, I would like those working with me to be able to access a directory on the domain if they have the Username and Password. By doing so, they should be able to browse the directory, it's contents and any sub-directories. Yet, the images in this directory are used as graphics in web pages, and I would still like those graphics to be displayed within web pages to the general public. I don't know if such an arrangement is possible, but my main goal is to block outsiders from viewing the contents of a particular directory, but still allow verified access to the same directory to those who need to view its contents as part of their daily business routine - but the graphics contained within should display on web pages for all to see... Any thoughts? Thanks so much for any and all advise you are able to impart, it is much appreciated. Dean Thank you to everyone for your warm welcome! Quote
TweezerMan Posted July 13, 2005 Posted July 13, 2005 I don't think what you're asking is possible. I think if you want your web images to be viewable by everyone, you'd need to place them in an unprotected directory. Quote
DaffiDuck Posted July 14, 2005 Posted July 14, 2005 If you "password protect" a directory such as photos does it stop it from people viewing it on your webpages directly? I guess I am asking WHAT password protecting a directory really acomplishes, as it might help me with the issues I am having with one person. Quote
TCH-Thomas Posted July 14, 2005 Posted July 14, 2005 From my own experience, all pages within a passworded directory will be protected. So no matter if you try to access one of those pages directly within the directory you will be asked for the log in info. Quote
AlanV Posted July 16, 2005 Posted July 16, 2005 If you use htaccess/htpasswd to password protect a directory, then any attempted access to the file will prompt for a username/password, even if it's just an image embedded in another page somewhere. What you could do is, assuming you have an index file for the directory, use a simple password script on the index before you're allowed to view the images/etc. Since the index file is what's loaded when a user enters a directory name, this would theoretically work... Then, to get a directroy listing, you'd just have to make the index.html/.php (probably php if you're doing password protection) file a directory list with links to every file. The reason you can't use htaccess/htpasswd passwording to only prevent directory listing is because they assume you only want authorized people to view the folder's contents. If you link the images somewhere, people could just click the link and see the file (if it didn't protect everything in the directory). So yeah, that's a long way of saying that, as far as I know, you can't do exactly what you want, but you can do something that could work. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.