IIS: Root Level Access with Multiple Domains

IIS: Root Level Access with Multiple Domains

am 24.08.2007 02:08:34 von Peter

Hey there, I've created a PHP testing environment on my PC using IIS.
The default web root directory is C:\Inetpub\wwwroot.

Every domain that I test sits underneath it, like:

C:\Inetpub\wwwroot\Site1
C:\Inetpub\wwwroot\Site2

etc...

The problem that I'm having is that in my PHP code, sometimes I would
like to include files by referencing them at the root level, i.e.
include('/somefile.php'). This of course works on the production
Apache web server, however, on my local installation the '/' refers to
the 'wwwroot' directory instead of the domain (or folder).

Is there a way to configure IIS to look at each folder as the root?

What I tried was creating a Virtual Directory inside IIS and mapped
this to each folder/domain. But this didn't work unfortunately.

Any ideas?

Re: IIS: Root Level Access with Multiple Domains

am 24.08.2007 06:21:37 von Kristofer Gafvert

Hello,

No, that is not possible with IIS (how would the web server know if you
mean the application root or really want to go the website root?). The
application framework (PHP in your case) may have something that supports
this. ASP.NET have tilde that referes to the application root, perhaps PHP
has something similar?

Are you using Windows XP? Perhaps multiple websites in IIS is better?

"Multiple websites on Windows XP Professional"
http://www.gafvert.info/iis/article/multiple_websites_xp.htm

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


Peter wrote:

>Hey there, I've created a PHP testing environment on my PC using IIS.
>The default web root directory is C:\Inetpub\wwwroot.
>
>Every domain that I test sits underneath it, like:
>
>C:\Inetpub\wwwroot\Site1
>C:\Inetpub\wwwroot\Site2
>
>etc...
>
>The problem that I'm having is that in my PHP code, sometimes I would
>like to include files by referencing them at the root level, i.e.
>include('/somefile.php'). This of course works on the production
>Apache web server, however, on my local installation the '/' refers to
>the 'wwwroot' directory instead of the domain (or folder).
>
>Is there a way to configure IIS to look at each folder as the root?
>
>What I tried was creating a Virtual Directory inside IIS and mapped
>this to each folder/domain. But this didn't work unfortunately.
>
>Any ideas?