You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by da...@excite.com on 2004/01/05 15:21:25 UTC

[users@httpd] mod_vhosts_alias + UserDir?

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

Related question how do I get it to match both mustard.com and www.mustard.com or is this a DNS cofig issue?


TIA,

David 




_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

---------------------------------------------------------------------
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] mod_vhosts_alias + UserDir?

Posted by Robert Andersson <ro...@profundis.nu>.
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