Placing a .htaccess file in the root and also below the root in a folder.

Discussion in 'Apache' started by deco12, Oct 4, 2007.

  1. #1
    Hi,

    I am new to web design and Apache, but have managed to password protect my site by putting a .htaccess file in the sites root directory.

    I have set it up so that a number of members have access to the site.

    Now, within the site I have a link to a "document" folder which I only want 2 or 3 members to have access to. I have created a second .htaccess & .ht passwd file, with the path to the new folder and a different password. This was placed in the "document" folder.

    However, I can log into the site with no problems, but when I click on the link to the "document" folder, I am presented with the password screen. The problem is that the password will not work. Neither will the password for the .htaccess file in the root directory!!

    Am I missing something?? Is it possible to place a .htaccess file on a folder that is already protected by a .htaccess file in the root? If so how can I get around this.

    Thanks in advance.....
     
    deco12, Oct 4, 2007 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    I think so. I will test it later if you don't get a clear answer.

    I have experienced problems before when I used cPanel to set up the restriction, user and password. Simply deleting it and redoing it solved the problem.
     
    Colbyt, Oct 4, 2007 IP
  3. deco12

    deco12 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Colbyt,

    Did you get a chance to test this, I still haven't managed to get it to work?

    Thanks.
     
    deco12, Oct 5, 2007 IP