You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Oded Arbel <od...@typo.co.il> on 2002/12/18 16:35:23 UTC

[users@httpd] mod_vhost_alias and user directories

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
    </IfModule>
</Directory>
-- 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 ?

TIA

-- 
Oded 

---------------------------------------------------------------------
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