IIS7虚拟目录重定向 [英] IIS7 Virtual Directory Redirects
问题描述
在旧的IIS6服务器上,我们通过以下方式处理IIS重定向:
On our old IIS6 server, we handled IIS redirects by:
- 在网站上设置虚拟目录
- 将虚拟目录指向服务器上的物理路径
- 在VD属性中,将其设置为重定向到URL
我正在尝试通过执行以下操作在IIS7中复制它:
I'm trying to replicate this in IIS7 by doing the following:
- 在网站上设置虚拟目录
- 将虚拟目录指向服务器上的物理路径
- 在VD功能中,双击HTTP Redirect并添加要重定向到的URL.
- Set up a virtual directory on the site
- Point the virtual directory to a physical path on the server
- In the VD features, double click on HTTP Redirect and add the URL to redirect to.
如果我只有一个虚拟目录,这可以正常工作.如果添加另一个,则第二个VD中的设置将覆盖第一个VD中的设置!
This works fine if I only have one virtual directory. If I add another, the settings in the second VD overwrite the settings of the first!
这是一个常见问题,是否有人找到解决方法?任何事情都将不胜感激.
Is this a common issue, and has anyone found a workaround? Anything would be appreciated.
推荐答案
在IIS 7中为虚拟目录配置HTTP重定向时,它将在物理路径中创建一个web.config文件.解决方法是将每个虚拟目录指向唯一的物理路径.
When you configure an HTTP Redirect in IIS 7 for a Virtual Directory it creates a web.config file in the physical path. The work around is to point each Virtual Directory to a unique physical path.
我使用这样的文件夹结构: \ path \ redirects [site_name] [virtual_dir_name]
I use folder structure like this: \path\redirects[site_name][virtual_dir_name]
这篇关于IIS7虚拟目录重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!