Virtual Directory in IIS

本文介绍如何在IIS 7中创建和配置虚拟目录。虚拟目录映射到服务器上的物理路径,允许用户通过URL访问特定文件夹的内容,如网页和其他文件。文中详细解释了虚拟目录的作用,并提供了创建步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://www.iis.net/configreference/system.applicationhost/sites/site/application/virtualdirectory

Overview

The <virtualDirectory> element is a child of the <application> element and controls the configuration settings for a specific virtual directory.

A virtual directory is a directory name (also referred to as path) that you specify in Internet Information Services (IIS) 7 and map to a physical directory on a local or remote server.

The virtual directory name becomes part of the application's URL, and users can request the URL from a browser to access content in the physical directory, such as a Web page or a list of additional directories and files.

If you specify a different name than the physical directory for the virtual directory, it is more difficult for users to discover the actual physical file structure on your server because the URL does not map directly to the root of the site.

 

In IIS 7, each application must have a virtual directory, known as the root virtual directory, and maps the application to the physical directory that contains the application's content.

However, an application can have more than one virtual directory.

For example, you might use a virtual directory when you want your application to include images from another location in the file system, but you do not want to move the image files into the physical directory that is mapped to the application's root virtual directory.

 

HOW TO CREATE A NEW VIRTUAL DIRECTORY

  • In the Connections pane, expand the server name, expand Sites, expand the Web site to which you want to add the virtual directory, and then click the application to which you want to add the virtual directory.

     

  • In the Actions pane, click View Virtual Directories, and then click Add Virtual Directory...
  • In the Add Virtual Directory dialog box, at a minimum enter information in the Alias: and Physical path: text boxes, and then click OK.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值