|
Posted by Rik on 01/19/07 13:03
Paul wrote:
> On my development computer, I have virtual named host set up, like
> www.site1.lab.
>
> When I upload those to my web site for customer review under
> mywebsite.com/clients/site1/
> it throws some of the source file references off and it does not work
> properly.
>
> My references are like:
> require_once($_SERVER['DOCUMENT_ROOT']."/utility/top.php");
>
> Obviously those will not work since $_SERVER['DOCUMENT_ROOT']
> references mywebsite.com.
>
> Is there anything I can do in apache.conf for a virtual directory
> that would make it so when I upload a site for customer review, I
> don't have to change the source references?
As long as you've really got a virtualhost set, and set the DocmentRoot for
that domain explicitly, is should have the right $_SERVER['DOCUMENT_ROOT'].
Relevant settings:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/path/to/test/docroot"
ServerName test.localhost
</VirtualHost>
server.php:
<?php
echo $_SERVER['DOCUMENT_ROOT'];
?>
Which correctly results in : /path/to/test/docroot
--
Rik Wasmus
Navigation:
[Reply to this message]
|