2 documentroots set up possible

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I found the link but it doesn't seem to help at all.
I'd like to use 2 directories as root ones at the same time. If this is
possible please explain how, I am grateful.

Re: 2 documentroots set up possible

Jersay Ballot wrote:

Quoted text here. Click to load it

This is actually more of an Apache configuration issue, and doesn't
have anything to do with PHP. However, your httpd.conf (or wherever the
virtual host configuration for your hostname(s) are in your Apache
configuration files) has to have something like this for your virtual

  ServerName example.com
  DocumentRoot /www/example.com
  Alias /root /var/localhost/htdocs
  <Directory /www/example.com>
    Order allow, deny
    Allow from all
    AllowOverride All
  <Directory /var/localhost/htdocs>
    Order allow, deny
    Allow from all
    AllowOverride None

Please note that this is just an example on how to do this. In the
above example, files for http://example.com/ are physically located in
/www/example.com, while files for http://example.com/root/ are located
in /var/localhost/htdocs on your server.

You can also do the same outside the <VirtualHost> block, but then the
Alias'ed directory will be available on all virtual hosts on that

This can only be done inside the main Apache configuration (global) and
inside a <VirtualHost> block (local to a virtual host), and not from a
.htaccess file, ie. you will need access to the main Apache

If you don't have access to the Apache configuration, the only option
left would be to set up a symbolic link if you have the FollowSymLinks
option set.

Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

Site Timeline