On 2/6/06, Cj B <[EMAIL PROTECTED]> wrote:
> Hello, I have a question about limiting users to a direcotry,
> basically I want to limit the users to a certain directory. ie: user1
> would be limited to browsing user1's directory. Currently I am doing
> the following for each user in the htpasswd file:
>
> Alias /user1 "/export/home/user1"
> <Directory "/export/home/user1">
> AuthName Admin
> AuthType Basic
> AuthUserFile /usr/local/apache1/conf/cliweb-passwd
> Options None
> AllowOverride None
> Order allow,deny
> Allow from all
> require user user1
> </Directory>
>
> I was wondering if there's a faster way to do this, so that I don't
> have to create an entry for each user?
Something like this:
<Directory /export/home>
...
require valid-user
</Directory>
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule ^/(.*) /export/home/%1/$1
This actually hides the users' directory name, which may or not be
what you want. Also be careful about what happens if REMOTE_USER is
empty.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]