Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple .htaccess protected folders

    Hi all - a newbie here.

    I have a site with several folders that I would like to protect. I'm using the .htaccess protection method by simply making the folders "private". I want to be able to allow users access to all of these protected folders with a single login. As it is right now, each time they go to a protected folder, they have to re-enter the username and PW each time. Is there an easy way to do this?

    Thanks.

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Yes. Create one main folder and put all of those folders inside that one. Then just have the login for the main folder.
    And then for the .htaccess part which I assume you should already have this but for the benefit of others this is essentially what you would use:

    Code:
    AuthType Basic
    AuthName "Title of your password protected area"
    AuthUserFile /pathtoyour/htpasswd/file
    require valid-user
    and of course in your htpasswd file would be the username:password. And always make sure your htpasswd file is above the your web root directory or in some directory not accessible by the web.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. However, I think I have a problem. Two of the folders have PHP based applications already installed and up and running (Coppermine Photo Gallery and phpBB). I'm afraid that if I move these folders, they'll get messed up and stop working. and I don't want to start these over again. Anything else I can try?

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Unless they are all under the same directory the user is going to get prompted to log in for each protected directory.

    You can always just copy those other directories there and test things out leaving the originals in place. As for phpBB if any changes need to be made you can simply open the adminstrative control panel and adjust and directory paths that might be affected. I am not familiar with the Coppermine Photo Gallery but I am sure it probably either has an administrative control panel where you can adjust any settings or at least a configuration file you can open and adjust any settings that might be affected.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •