I was wondering is there a way to password protect a directory. Here is my problem. My site require a login using php and mysql. This works, however I want to protect a certain directory that only lets a user who login previously to download files from it. I can keep non-user from viewing any other pages but they can still download a file via direct link. I want to stop this. I know I can use .htaccess files but that would require another login from the user. Is there a way to combine the two login into one? Thanks for your help in advance.

8 Years
Discussion Span
Last Post by chrishea

You may want to consider putting the directory for the downloads outside the web root on your server. That way, it can only be accessed through a program and that program can check the login info to see if the user has the authority to do it. You can do a search and get more info (I provided one link below). There are some considerations so do a bit of research.


This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.