Search | Contact | Link To Us  

      ASP.NET      

ASP.NET
Dev Environment
Web Forms
Web Controls
ADO .NET
Web User Controls
Deployment
XML Web Services
ASP.NET Feedback Form
Resources
Discussions
VB .NET
About



Advertisement













































































































     HomeASP.NETDeploymentConfiguring Websites in IIS 6.0> Creating Virtual Directories 

Configuring Websites in Windows .NET Server/IIS 6.0

Virtual Directories

A virtual directory is a friendly name, or alias, either for a physical directory on your server hard drive that does not reside in the home directory, or for the home directory on another computer. Because an alias is usually shorter in length than the path of the physical directory, it is more convenient for users to type. The use of aliases is also secure because users do not know where your files are physically located on the server and therefore cannot use that information to modify your files. Aliases also make it easier for you to move directories in your site. Rather than changing the URL for the directory, you change the mapping between the alias and the physical location of the directory.

You must create virtual directories if your Web site contains files that are located in a directory other than the home directory, or on other computer's hard drive. To use a directory on another computer, you must specify the directory's Universal Naming Convention (UNC) name, and provide a user name and password for access rights.

Also, if you want to publish content from any directory not contained within your home directory, you must create a virtual directory.

Creating a Virtual Directory

Let's say Startvbdotnet keeps their contacts in a folder called C:\StartvbdotnetContacts on their web server and would like users to be able to use the URL http://169.16.13.211/contacts when they need to access contact information. To do this we need to create a virtual directory that associates the /contacts portion of the URL, the alias for the virtual directory, with the physical directory C:\StartvbdotnetContacts where these documents are actually located.

To create a new virtual directory, right-click on Startvbdotnet Web site and select New->Virtual Directory to start the Virtual Directory Creation Wizard. The images below display that.



Click Next and type the alias for the virtual directory, say, contacts as shown in the image below.

Click Next and specify the physical folder on the local server to map to this alias. The physical folder on the server is C:\StartvbdotnetContacts. The image below shows that.

Click Next and specify permissions for this Virtual Directory as shown in the image below.

Click Next and finish the virtual directory creation wizard. The images below displays the result. You can
see the new virtual directory, contacts, with a gear symbol in the IIS wizard.



When users type http://169.16.13.211/contacts in their browser they will be shown a page with contact information for Startvbdotnet Web site. What actually happens is the content comes from a directory located outside the Web site directory but the address bar in the browser shows that the directory is part of the Web site.

Next>>Controlling Access to Web site

  Privacy Policy | Terms of Use | Site Map | Contact

  © 2004-2010 Startvbdotnet.com. All rights reserved.