httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oded Arbel <>
Subject [users@httpd] mod_vhost_alias and user directories
Date Wed, 18 Dec 2002 15:35:23 GMT
Hi Apache users!

I want to ask a question about mass virtual hosting.
I've setup a mass virtual host with mod_vhost_alias that will map queries for 
HTTP://hostname/ into /vhosts/hostname/public_html.
Now I want to also be able to have an effect similar to what mod_userdir does 
with a standalone host - specificly to map http://hostname/~username to 
/vhosts/hostname/users/username/public_html. I've achived this by setting up 
mod_rewrite with this set of rules :

-- snip --
RewriteEngine on
RewriteRule /~([^/]+)$  /vhosts/%{HTTP_HOST}/users/$1/public_html
RewriteRule /~([^/]+)/(.*)      /vhosts/%{HTTP_HOST}/users/$1/public_html/$2
-- snip --

and also access control like this
 -- snip --
<Directory /vhosts/*/users/*/public_html>
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride All
    <IfModule mod_access.c>
        Order allow,deny
        Allow from all
-- snip --

(everything else, except the "real" host's public_html is denied of course). 
now my problem is that using this setup, if a query comes for a user that a 
directory does not exist for, then it is denied with a 403 (forbidden) error 
- apache tries to travel the directory tree, and when it reaches 
/vhosts/hostname/users/invalidusername it does not find anything there and 
issues a 403 error with this in the error log:

-- snip --
[Wed Dec 18 17:33:09 2002] [error] [client xx.xx.xx.xx] client denied by 
server configuration: /vhosts/hostname/users/invalidusername
-- snip --

I want apache to reject such queries with a 404 (not found) error - can it be 
done ?



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