Virtual directory with iis

Posted on 2012-09-01
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

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

    Author Comment

    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

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now