Using Virtual Directories with FTP Sites (IIS 6.0)
A virtual directory is a friendly name, or alias, either for a physical directory on your server hard disk that does not usually reside under the FTP site's home directory. The use of aliases is secure because users do not know where your files are physically located on the server relative to the FTP site's home directory, and therefore cannot use that information to attempt 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 need only change the mapping between the alias and the physical location of the directory.
Another advantage of aliases is that you can publish content in multiple directories, to be accessed by all users, and control read/write permissions for each virtual directory separately. Even with User Isolation enabled, you can share public content by creating a virtual directory with access permission for all users.
If your FTP site contains files that are located in a directory other than the home directory, or on other computers, you must create virtual directories to include those files in your FTP site. To create a virtual directory that points to a physical directory on another computer, you must specify the full UNC path to the directory, and provide a user name and password for user rights.
If you want to publish from any directory not contained within your home directory, you must create a virtual directory. For example, suppose you are setting up a FTP site for your marketing team on your company's intranet. The following table shows an example of how you might construct the mapping between the physical location of the files and the URL that accesses the files.
Both virtual directories and physical directories (directories without an alias) appear in IIS Manager. A modified folder icon indicates a virtual directory. The following illustration shows the FTP site example described above, where Customers, PR, and PRPublic are virtual directories.
You can also define nested virtual directories. For example, within the PR virtual directory, you can create another virtual directory, for example, named Oldpr. The content in Oldpr is accessible using the URL ftp://SampleFTPSite/PR/Oldpr.
The FTP server does not include the names of any virtual directories when the content of the current working directory is requested by a client application. Physical directories, however, are listed.
Access to the content of a virtual directory depends on the current working directory. For example, if a user is connected to the root directory of SampleFTPSite, assuming that the user has the necessary permissions, the user can change the working directory to the following paths: /PRPublic, /PR, /PR/Oldpr, and /Customers only if the user knows the site structure. For example, if the current working directory is /PRPublic, the user will receive an error message when attempting to change the working directory to /PR by typing the command cwd /PR, but will successfully change the working directory to /PR by typing the command cwd ./PR.
Also, a user can use a combination of physical directory names and virtual directory names to change the working directory. For example, assume that under the physical path to which the PR virtual directory is mapped, there is a physical folder named Test, and the current working directory is the root of SampleFTPSite. The user can change the working directory to the physical Test folder using the command cwd PR/Test.
For a basic FTP site, you can place all of your files in the site's home directory, and most likely do not need to add virtual directories. If you have a complex site, or want to specify different URLs for different parts of your site, you can add virtual directories as needed. To make a virtual directory accessible from multiple sites, you must add the virtual directory to each site.
There are two ways to create or delete a virtual directory:
You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /User:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".
To create a virtual directory using IIS Manager
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer\Administrator cmd to open a command window with administrator rights and then type cscript.exeScriptName (include the script's full path and any parameters).
To create a virtual directory using the Iisftpdr.vbs administration script
Deleting a virtual directory does not delete the corresponding physical directory or files.
To delete a virtual directory using IIS Manager
To delete a virtual directory using the Iisftpdr.vbs administration script