Jump to content

Archived

This topic is now archived and is closed to further replies.

elliterate

Multiple Domains with Different PHP Document Roots?

Recommended Posts

That's my best guess.

We have two domains, one technically a sub-domain of the other, but both are document-rooted at E:\. One is E:\www.example.com\ while the other is E:\dev.example.com\. We've created two separate websites in the IIS Manager, one for each domain, setting the Document Root appropriately for each one.

For some reason, however, when we load a .php file in the [i]dev[/i] domain, it loads the corresponding .php file in the [i]www[/i] domain. If the .php is in both dev and www, we can reach it in the browser at either domain. If it is missing from the dev site, it will only be visible in the www domain. If it is only missing from the www site, it won't be visible to either site, even if it's still in the dev site.

Go figure.

When I try and view phpinfo() from a webpage, it reveals that, while all other parameters are correct, the document root is always set to E:\www.example.com\, no matter what domain I'm looking at. I went into the php.ini file and, lo-and-behold, the doc_root parameter is set to E:\www.example.com\. When I set it to E:\dev.example.com\, everything I've previously described continues to happen, but in the other direction. So if you go to www.example.com/index.php, it loads dev.example.com/index.php locally while retaining the www URL in your address bar.

When I comment out the doc_root completely from php.ini, it's as if it was still set to E:\www.example.com, the only difference being it no longer shows up in the phpinfo() output.

Any idea what's causing this problem?

(I really ned to be able to keep their directory structures separate -- not have one be a sub-folder of the other -- to obtain proper development environment separation.)

--

Stats:

IIS 6.0
Microsoft Windows Server 2003, Standard Edition
PHP 5.0 (tried both CGI and ISAPI)

Share this post


Link to post
Share on other sites
if you want multiple domains eg: d:\site1, d:\site2 etc etc just leave the doc_root blank, restart IIS and hey presto php all over the place (took me a while to wok it out).

hth

tim

[!--quoteo(post=357809:date=Mar 23 2006, 07:22 PM:name=elliterate)--][div class=\'quotetop\']QUOTE(elliterate @ Mar 23 2006, 07:22 PM) [snapback]357809[/snapback][/div][div class=\'quotemain\'][!--quotec--]
That's my best guess.

We have two domains, one technically a sub-domain of the other, but both are document-rooted at E:\. One is E:\www.example.com\ while the other is E:\dev.example.com\. We've created two separate websites in the IIS Manager, one for each domain, setting the Document Root appropriately for each one.

For some reason, however, when we load a .php file in the [i]dev[/i] domain, it loads the corresponding .php file in the [i]www[/i] domain. If the .php is in both dev and www, we can reach it in the browser at either domain. If it is missing from the dev site, it will only be visible in the www domain. If it is only missing from the www site, it won't be visible to either site, even if it's still in the dev site.

Go figure.

When I try and view phpinfo() from a webpage, it reveals that, while all other parameters are correct, the document root is always set to E:\www.example.com\, no matter what domain I'm looking at. I went into the php.ini file and, lo-and-behold, the doc_root parameter is set to E:\www.example.com\. When I set it to E:\dev.example.com\, everything I've previously described continues to happen, but in the other direction. So if you go to www.example.com/index.php, it loads dev.example.com/index.php locally while retaining the www URL in your address bar.

When I comment out the doc_root completely from php.ini, it's as if it was still set to E:\www.example.com, the only difference being it no longer shows up in the phpinfo() output.

Any idea what's causing this problem?

(I really ned to be able to keep their directory structures separate -- not have one be a sub-folder of the other -- to obtain proper development environment separation.)

--

Stats:

IIS 6.0
Microsoft Windows Server 2003, Standard Edition
PHP 5.0 (tried both CGI and ISAPI)
[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.