Virtual directory with iis

Posted on 2012-09-01
Medium Priority
Last Modified: 2012-09-04

I am stuyding about "virtual directory" now and I am little bit confused about this concept.

I learned that "c:\Inetpub\wwwroot" will be created as a root directory when I install IIS.

For example, if I create "a.aspx" file and put it under root directory (C:\Inetput\www.root\a.aspx), I can enter "http://localhost/a.aspx" to a web browser's address bar.

Lest's say that I want to creat a virtual directory.  I used "myWeb" as an alias and "C:\myExample" as a physical path.  
Then, I copied a.aspx into C:\myExample folder.
Now I can access "a.aspx" using "http://localhost/myWeb/a.aspx".

So I guess that it's like accessing "C:\Inetpub\wwwroot\myExample\a.aspx".
However, it doesn't make sense since myExample is under C directory.

Could you please explain the relationship among "C:\Inetput\www.root", "C:\myExample", and "http://localhost etc.
Question by:IzzyTwinkly
LVL 12

Expert Comment

ID: 38357993
I am in two minds if this is a genuine question or we are doing your assignment work for you:-)?

Author Comment

ID: 38358104
Hi xmlmagician,

What made you think that this is for my homework?
I am just curious.  If I know what that is, I can avoid spending my time to tell you that this is my real question.

I expected the answer for my question when I received the email saying that the possible answer was posted for the question and now I see your irrelevant comment instead.  It is really frustrating.
LVL 10

Accepted Solution

himanshut earned 2000 total points
ID: 38359753
Your IIS root directory is : http://localhost/

If you want to deploy some project/website under http://localhost path then you have to create a new website as Default Web Site, which will physically point to your project.

"Lest's say that I want to creat a virtual directory.  I used "myWeb" as an alias and "C:\myExample" as a physical path."
Based on the above you do create a virtual directory "myWeb" that will contain your a.aspx page which can be accessed via http://localhost/myWeb/a.aspx

In case you want to access this page right under http://localhost, you need to create "Default Web Site" with physical path of your application i.e. C:\myExample and anything under this application can be accessed via http://localhost/a.aspx or so on.

Hope this info does clear out your doubts.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month16 days, 1 hour left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question