Should the physical path of an IIS Application match the virtual path?

705 views Asked by At

I understand that the physical path of an Application in IIS is not required to live in the same location reflected in the virtual paths. Of course, it can be done that way.

Is it considered bad practice to have this overlap? Are there any negative consequences that might occur by doing this?


Here is an example:

I have a website at c:\inetpub\wwwroot and I deploy two applications:

Virtual Paths:
/apps/Application1
/apps/Application2

Physical Paths:
C:\inetpub\wwwroot\apps\Application1
C:\inetpub\wwwroot\apps\Application2


An alternative solution might be this:

Virtual Paths:
/apps/Application1
/apps/Application2

Physical Paths:
C:\inetpub\Application1
C:\inetpub\Application2

2

There are 2 answers

0
Brandon Spilove On

No, the physical path does not need to match the virtual path. It's totally up to you how you want to set it up.

0
user803469 On

They can be different. I use different physical paths in many cases. A lot of times it's easier to deploy to some well known physical location with a date or release number as part of the directory name... and have a (sometimes branded) user oriented path on the server.