I was wondering what a rewrite statement that looks for this situation:
I want to have multiple users on my server. Each user can have VirtualDocumentRoot
like sites in their directory. For example, they just make a directory like example.com
in their home directory, and it's hosted.
The problem is I don't know if VirtualDocumentRoot
can do this, or if it would take a rewrite rule that looks in all the users folders for a domain.
Can anybody help me?
VirtualDocumentRoot
is indeed the directive you want. This site has some details, including some very important caveats about Bad Things that can happen with PHP and the$_SERVER['DOCUMENT_ROOT']
value but the basics:should send you to
/home/www/sites/foo.com
if the browser requests foo.com.You should also spend some quality time with the Apache Manual's mod_vhost_alias section which will give you better configuration details than my 5-second slap job above.