homepage Welcome to WebmasterWorld Guest from 54.161.192.130
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Allow access to subdirectory only
imanewbe



 
Msg#: 4662821 posted 7:36 am on Apr 14, 2014 (gmt 0)

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

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4662821 posted 12:50 pm on Apr 14, 2014 (gmt 0)

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

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4662821 posted 3:44 pm on Apr 14, 2014 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved