Wednesday, November 24, 2010

Create Virtual Directories in IIS 7.0

By using IIS Manager, you can create a virtual directory for an ASP.NET Web application that is hosted in IIS 7.0. A virtual directory appears to client browsers as if it is in the Web server's root directory, even though it can physically reside somewhere else. This approach enables you to publish Web content that is not located under the root folder of the Web server, such as content that is located on a remote computer. It is also a convenient way to set up a site for local Web development work because it does not require a unique Web site for each virtual directory.

You must create a virtual directory as part of an existing IIS Web site. This can be either the default Web site that is created when IIS is installed, or a Web site that you have created.

Creating the Virtual Directory

Follow one of the procedures in How to: Open IIS Manager topic to open IIS Manager. You can then create a virtual directory.

To create a virtual directory by using IIS Manager
   1.      In IIS Manager, expand the local computer and the Sites folder, and then find the Web site that you want to add a virtual directory for. Use the following steps:
          *            For , right-click the site or folder where you want to create the virtual directory, and then click Add Virtual Directory.
          *            For Windows Server 2008, right-click the site or folder where you want to create the virtual directory, click Manage Web Site, and then click Add Virtual Directory.
   2.      In the Add Virtual Directory dialog box, specify the following information:
          *            Alias. Type a name for the virtual directory. Choose a short name that is easy to type, because the user types this name to access the Web site.
          *            Physical Path. Type or browse to the physical directory that contains the virtual directory. You can select an existing folder or create a new one to contain the content for the virtual directory.
   3.      To provide credentials to connect to a UNC path, click the Connect as button.
   4.      Click OK.

No comments:

Post a Comment