Configuration settings for virtual directories, which are friendly names for directories that simplify access paths and hide the names of real directories, are independent of physical-directory structure. As a result, virtual directories must be organized carefully to avoid configuration problems. For example, you might set up virtual directories to retrieve the ASP.NET page named MyResource.aspx from the following physical directory structure.
|
MyDir
SubDir1 (mapped from VDir1)
SubDir1A (mapped from VDir1A)
MyResource.aspx
SubDir2
|
In this example, there is a Web.config file in SubDir1 and another Web.config file in SubDir1A. If a client accesses C:\Subdir1\Subdir1A\MyResource.aspx using the URL http://localhost/vdir1/subdir1A/MyResource.aspx, the resource inherits configuration settings from Vdir1. However, if the client accesses the same resource using the URL http://localhost/vdir1A/MyResource.aspx, it does not inherit settings from Vdir1. Therefore, creating virtual directories in this manner is not recommended because it can cause unexpected results or even an application failure.
Internet Information Services (IIS) is the Web server for all resources published over the Web. The ASP.NET configuration system applies only to ASP.NET resources, which are the resources that are registered to be handled by ASP.NET using Aspnet_isapi.dll. By default, the configuration system does not provide security for non-ASP.NET resources. For example, ASP, HTML, TXT, GIF, and JPEG files are accessible by all users. In the preceding example, if directory browsing is enabled and no other restrictions are in place, all users can view non-ASP.NET files located in the application root directory, SubDir1, and SubDir2.