Forum Moderators: phranque

Message Too Old, No Replies

Allow access to subdirectory only

         

imanewbe

7:36 am on Apr 14, 2014 (gmt 0)

10+ Year Member



I have a .htaccess file with the following in it
AuthName "Username and password required" 
AuthType Basic
AuthUserFile /home/john/www/.htpasswd
AuthGroupFile /dev/null
require valid-user


What I want to do is only allow access to a subdirectory rather than the directory that the htaccess file is in once they user has logged in.

Is this possible? If so how would I go about doing this?

phranque

12:50 pm on Apr 14, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, imanewbe!


What I want to do is only allow access to a subdirectory rather than the directory that the htaccess file is in once they user has logged in.

move that .htaccess file to the subdirectory.

lucy24

3:44 pm on Apr 14, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That was my immediate response too, but then I thought there must be protected material in the outer directory. I think really we need more information. Among other things, can the directory structure be rearranged? Putting accessible content inside of inaccessible content doesn't seem the safest.

Granted, every website in the world does the same thing to some extent. Nobody can run wild in the / (physical top level) directory. But here we're on a deeper level.