httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] Limit user per directory
Date Tue, 07 Feb 2006 16:15:46 GMT
On 2/6/06, Cj B <> 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
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


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message