htaccess subfolder

I have an htaccess file that users login as a client.  All clients with a password can get to this folder.  I also want clients to have access to their own subfolder.  can I allow clients access to their own subfolder without a second login prompt while still narrowing the access to the subfolders so that all clients do not have access to all folders?
Who is Participating?
purplepomegraniteConnect With a Mentor Commented:
Full details for htaccess are found here:

Points worth noting btw, copied straight from Apache documentation:

There are two main reasons to avoid the use of .htaccess files.

The first of these is performance. When AllowOverride is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them! Also, the .htaccess file is loaded every time a document is requested.

The second consideration is one of security. You are permitting users to modify server configuration, which may result in changes over which you have no control. Carefully consider whether you want to give your users this privilege. Note also that giving users less privileges than they need will lead to additional technical support requests. Make sure you clearly tell your users what level of privileges you have given them. Specifying exactly what you have set AllowOverride to, and pointing them to the relevant documentation, will save yourself a lot of confusion later.

Note that it is completely equivalent to put a .htaccess file in a directory /www/htdocs/example containing a directive, and to put that same directive in a Directory section <Directory /www/htdocs/example> in your main server configuration:
Oooo, fun.

You are using Apache I presume?  On Windows or Linux?
If i understannd it correctly, each folder has its own .htaccess file. Each .htaccess file *can* specify a separate .htpasswd file or use a common one. So you can protect each folder as much or as little as you want. I'm not sure, however, if the way the browser cookies work mean that logging in to one folder as UserX means you can access a second folder as the same user without logging in again.

I can feel an experiment coming along.
Well, htaccess files don't create cookies anyway, they cause the browser to authenticate with the server - which is nothing to do with cookies.  This means that if you have a Save Password option (Firefox does, as does Internet Destroyer... I mean, Explorer) that should be fine.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.