Hi there!
Is there any way to change the DOCUMENT_ROOT variable in PHP?
The thing is that I have one IP address and I want to change the DOCUMENT_ROOT depending on the HTTP_HOST variable.
For example: I have test.com and fake.com and they have their DOCUMENT_ROOT in /home/httpd/html/test and /home/httpd/html/test/fake respectively.
So, I want
<?
$root = getenv("DOCUMENT_ROOT");
$host = getenv("HTTP_HOST");
if ($host == "fake.com") {
$DOCUMENT_ROOT = "/home/httpd/html/test/fake ";
exit;
} else {
$DOCUMENT_ROOT = "/home/httpd/html/test/";
exit;
}
Is that possible to do without tweaking Apache conf files.
Thanks!
Sincerely yours,
Lubomyr Haidamaka
DMedia(tm) Ltd.
LHDM1-RIPE
tel. (044) 246 8644
ICQ 57530719
lubes@dmedia.com.ua
DMedia(tm) Ltd.- registration of domain
names and hosting. http://dmedia-ua.com