httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] Subdomain Config Questions
Date Tue, 17 Jun 2008 06:47:14 GMT


It was thus said that Sean Conner wrote:
> It was thus said that the Great Aaron Todd once stated:
You may prefer to do

> 
> <VirtualHost *:80>
# this will be the default host, when people try to access via
# IP address for instance
>   ServerName	www.example.net
>   DocumentRoot /var/www/somewhere-generic
     SetEnv SITE "wrong address"
> </VirtualHost>
> 
> <VirtualHost *:80>
>   ServerName	a.example.net
>   DocumentRoot /var/www/common
     SetEnv SITE "this is site A"
> </VirtualHost>
> 
> <VirtualHost *:80>
>   ServerName	b.example.net
>   DocumentRoot /var/www/common
     SetEnv SITE "this is site B"
> </VirtualHost>
> 
The first VirtualHost will be used whenever users access your site via 
other than "http://a.example.com" or "http://b.example.com" (e.g. by 
entering "http://120.10.123.123" - this being the IP address of your server)

The following two sites are what you seem to want : use the same 
document directory for both sites (subdomains), but set a variable 
differently depending on which way people come in.
In thisa case, I used SetEnv, which sets an environment value for 
cgi-bin scripts e.g., but with mod_perl you would use PerlSetVar, and 
with PHP something else probably.



---------------------------------------------------------------------
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


Mime
View raw message