httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: [users@httpd] mod_vhosts_alias + UserDir?
Date Mon, 12 Jan 2004 06:49:07 GMT
david.jay.jackson@excite.com wrote:
> I'm trying to use VirtualDocumentRoot to use the user home
> directory, the directory structor might look like this for
> (www.)mustard.com:
>
> /home/davej/vhosts/mustard.com/htdocs

I did a similar thing for a friend a while ago, although I haven't had
confirmation if it worked or not, but this might do it:

    <VirtualHost *>
        ServerName anything
        RewriteEngine On
        # If host is only two part, we add www and ask visitor to come again
        RewriteCond %{SERVER_NAME} ^([\w-]+\.[\w-]+)$
        RewriteRule (.*) http://www.%1$1 [R]
        # ...
        VirtualDocumentRoot /home/davej/vhosts/%-2.0.%-1/%-3+
        # Actually, I think you just want this:
        VirtualDocumentRoot /home/davej/vhosts/%-2.0.%-1
    </VirtualHost>

This code will redirect mustard.com to www.mustard.com before serving
content (good thing!). Might need some tweaking, I don't know. The original
problem was a bit more complicated, allowing arbitrary number of parts while
only using a fixed directory depth of two, so it might not be optimal for
your problem.

Regards,
Robert Andersson


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


Mime
View raw message