Define a subfolder as the document root

Hi guys,

I currently have a site set up like so:

Main doc root (Portal page - index.php)
-> Directory 1 (mini site)
-> Directoy 2 (2nd mini site)

Now, I am wanting make each directory it’s own document root with .htaccess so that i can define it’s own rewrite rules etc …

Is this possible?
I have been using the following:

DocumentRoot /Users/ico_ftp/webroot/portalroot/directory_1

But it does’nt seem to be making a difference.

Is this the correct syntax (directive?) to be using?


To make a sub folder or any folder a document root you have to use virtual host.

ah ha … thank you very much


So is it not possible to change the DocumentRoot from an htaccess? like above?

DocumentRoot /some/directory

I have to use virtual hosts instead?



DocumentRoot is DEFINED by the VirtualHost section in httpd.conf, NOT in .htaccess. It is a basic Apache configuration item which cannot be altered outside httpd.conf.