virtual directories/physical directories in IIS

P

Paul F

Im confused about the difference(s) between virtual directories and
physical
directories in IIS.

Any ideas?
 
J

Juan T. Llibre

A physical directory, i.e., a directory in your hard drive, can be pointed to by
IIS to configure a virtual directory, i.e., a directory that anybody can access
from outside your computer via http.
 
P

Paul F

May be my question wasnt quite clear, In Microsoft Internet Manager,
which
is the UI for IIS you can have physical and virtual directories inside
the
default web site, i want to know the difference between the two
structures
there
 
J

Juan T. Llibre

re:
!> you can have physical and virtual directories inside the default web site

You can not only have them inside the default website,
but you can also have them inside any web application.

I assume that you mean something like this :

--root directory
-- physical subdirectory of the root which is not configured as a virtual directory
-- physical subdirectory of the root which *is* configured as a virtual directory

Basically, the difference is that any web.config in a physical subdirectory cannot
contain references to MachineToApplication configuration sections, while in
virtual directories you can override MachineToApplication configuration sections.

To see which configuration sections are MachineToApplication ones, open the file machine.config.comments
with Notepad, or any other pure text editor, and search for the text "MachineToApplication".

Those configuration sections can only be configured when the application's web.config is in a
directory configured as a virtual directory, and cannot be configured in physical subdirectories.

Any section in machine.config marked as "MachineToWebRoot" can only be configured in the Application's root.
Any section in machine.config marked as "MachineOnly" can only be configured once for the whole server.
 
M

Mark Fitzpatrick

A physical directory is a directory that exists under the directory that the
web site is bound to. For example: inetpub\wwwroot (url would be
http://localhost) is the location the web site is pointing to.
inetpub\wwwroot\mydirectory is physically under that directory (url would be
http://localhost/mydirectory).

A virtual directory could be any directory that can be seen by the server.
let's say you had a bunch of files in a directory called d:\myfiles. You can
create a virtual directory called MyFiles in your web site (url would be
http://localhost/myfiles). To anyone browsing to that directory through the
web site, it behaves as if it's located within the web.

Easiest way to think of it is a shortcut folder for web servers.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top