You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Philippe <pb...@abritel.fr> on 2002/03/20 15:04:10 UTC

2 domain in the same root directory

Hello,

I want to configure two domain on the same root directory with for each 
domain a home page.

I create for each domain a virtual host, but when i ask for a domain, 
it's always index.php who is call.
In my config, I have indexdomain1.php and indexdomain2.php.

How can I config apache to serve the right index page for each domain ? 
I must have the same root because except the index page, the others 
pages are the same for both domains.


Thanks for your response.

best regards,

Philippe BARRIELLE
Sce Informatique
---------------------------------------------------------------------------------------------------
                            *  S.A. Editions et Publicites - ABRITEL *
109, La Canebière - B.P 2033 - 13201 Marseille cedex 01 - France
Tél  : 33 (0)4 91 11 00 72           Wap : http://wap.abritel.fr
Email: pbarrielle@abritel.fr         Web : http://www.abritel.fr
---------------------------------------------------------------------------------------------------
        LOCATIONS VACANCES - FRANCE - SPAIN - DOM - PORTUGAL
---------------------------------------------------------------------------------------------------


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: 2 domain in the same root directory

Posted by Owen Boyle <ob...@bourse.ch>.
Philippe wrote:
> 
> Hello,
> 
> I want to configure two domain on the same root directory with for each
> domain a home page.
> 
> I create for each domain a virtual host, but when i ask for a domain,
> it's always index.php who is call.
> In my config, I have indexdomain1.php and indexdomain2.php.
> 
> How can I config apache to serve the right index page for each domain ?
> I must have the same root because except the index page, the others
> pages are the same for both domains.

Create two virtualhosts, each with the same document root (as you have
already done, I think). But then, differentiate them using the
DirectoryIndex directive, i.e.

In VH1:
	ServerName     domain1
	DocumentRoot   /path/to/common-dir
	DirectoryIndex indexdomain1.php

in VH2:

	ServerName     domain2
	DocumentRoot   /path/to/common-dir
	DirectoryIndex indexdomain2.php

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


RE: 2 domain in the same root directory

Posted by James Green <ja...@stealthnet.co.uk>.
> Hello,
> 
> I want to configure two domain on the same root directory with for each 
> domain a home page.
> 
> I create for each domain a virtual host, but when i ask for a domain, 
> it's always index.php who is call.
> In my config, I have indexdomain1.php and indexdomain2.php.
> 
> How can I config apache to serve the right index page for each domain ? 
> I must have the same root because except the index page, the others 
> pages are the same for both domains.

Use a DirectoryIndex directive within each VirtualHost.

At least I think that's what you mean.

Regards,

James Green


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org