Virtual Folders


Using virtual folders

Virtual folders are one of the most powerful WWW Server features. You can use them to map different local folders to different sub-folders of your website, to different ports and to the different IP addresses your computer might have.

Basically, you enter a virtual folder name and choose a folder on disk you want to map to it. When multiple virtual folder names match for a certain request, the one the farthest below is taken. This means that you should order the list so, that the root folder is at the top, and the virtual sub-folders are below the virtual folder that contains them - just like in about any usual tree-view:

Folder               Maps to
/                    c:\website
/help                c:\project\documentation
/help/images         c:\project\images

When you want to edit your website, you can double-click any folder in the list to open it in the Windows Explorer.

Using virtual hosting

To make better use of your hardware, it is possible to host multiple websites on one computer. This is called Virtual Hosting. There are two ways to accomplish this.

The first way is to let the computer use two (or more) IP addresses at once, and let the desired hostnames point to the different IP addresses. This works with all web browsers, but it is more complicated to configure and additional IP addresses usually can't be had for free.

To use IP based virtual hosting, create a separate port for each IP address you have.It might be necessary (on Windows 2000/XP) to delete the default port. Then you can switch to the Folders tab and create multiple entries with the virtual path "/". With each of them, select the appropriate port.

The second way is to let multiple hostnames point to a single IP address. This works with almost all webbrowsers, saves IP addresses and is very easy to configure.

To use Hostname based virtual hosting, switch to the Folders tab and create multiple entries with the virtual path "/". With each of them, enter the appropriate hostname. It is not necessary to create additional ports in this case.

Hostname based virtual hosting does not work for users of old webbrowsers that do not send the "Host:" HTTP header. For these users, you might want to provide a virtual folder without Hostname option, containing (for example) a page to encourage them to download a newer web browser. In the folder list, this virtual folder should be placed above the virtual folders that do have a Hostname option.