You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Stefano Sasso <st...@gmail.com> on 2006/11/03 12:30:22 UTC

[users@httpd] LocationMatch and DirectoryMatch regex

Hi everybody, someone knows if is it possible to work with
regex-variables in LocationMatch or DirectoryMatch?

for exampe, I have this situation:

Alias /dav /srv/webhome

then every user can access via webdav on his own home dir only
<Location /dav/customer1>
...
DAV On
require user customer1
...
</Location>
<Location /dav/customer2>
...
DAV On
require user customer2
...
</Location>

is it possibile to have something similar, but with no need of
restarting apache every time a user is added?
is it possible to have something like:
<LocationMatch /dav/([a-zA-Z0-9]*)/>
...
DAV On
require user $1 # or something like this
...
</LocationMatch>

thanks
Stefano

-- 
Stefano Sasso
stesasso@gmail.com
Linux User #330315
http://www.gnustile.net.org/

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] LocationMatch and DirectoryMatch regex

Posted by Stefano Sasso <st...@gmail.com>.
2006/11/3, Joshua Slive <jo...@slive.ca>:
> No.  Sometimes you can use mod_rewrite to enforce similar
> restrictions, but you can't, in general, use wildcards like that.

thanks.
I've resolved using mod_rewrite. here the solution:

RewriteEngine On
RewriteRule ^/(.*) /srv/web/%{LA-U:REMOTE_USER}/$1

<Directory /srv/web>
DAV On
Options Indexes
Options +FollowSymLinks
AllowOverride None
AuthType Basic
AuthName "WebDAV"
AuthUserFile /etc/apache2/vhost.dav
require valid-user
</Directory>

bye
Stefano S.

-- 
---------------------------------------------------------------
Per favore non mandate allegati in Word o PowerPoint.
Si veda http://www.fsf.org/philosophy/no-word-attachments.html
---------------------------------------------------------------
Stefano Sasso
stesasso@gmail.com
Linux User #330315
http://www.gnustile.net.org/

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] LocationMatch and DirectoryMatch regex

Posted by Joshua Slive <jo...@slive.ca>.
On 11/3/06, Stefano Sasso <st...@gmail.com> wrote:

> is it possibile to have something similar, but with no need of
> restarting apache every time a user is added?
> is it possible to have something like:
> <LocationMatch /dav/([a-zA-Z0-9]*)/>
> ...
> DAV On
> require user $1 # or something like this
> ...
> </LocationMatch>

No.  Sometimes you can use mod_rewrite to enforce similar
restrictions, but you can't, in general, use wildcards like that.

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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org