1 |
> p.s.: does anyone know of a namebased virtualhosting module or similar for apache2 that doesn't require a graceful apache2 restart? |
2 |
|
3 |
You could redirect all requests of a certain domain by using |
4 |
<VirtualHost IP:80> |
5 |
ServerName *.domain.tld |
6 |
|
7 |
(other options needed for your vhost) |
8 |
</VirtualHost> |
9 |
|
10 |
Then you could easily determine which of your "virtual" vhosts is |
11 |
requested by using PHP. The current domainname is stored in the special |
12 |
variable $_SERVER['HTTP_HOST'] (something like "subdomain.domain.tld"). |
13 |
|
14 |
Now you can decide what page to display. But please note that this |
15 |
solution requires a PHP call for every file you serve (including CSS and |
16 |
images). This may cause a significant performance impact because Apache |
17 |
won't able to cache anything. |