【发布时间】:2013-12-17 15:06:04
【问题描述】:
多年来,我一直在使用 iis7 Win server 2008 RC2 在我的服务器上使用 url rewrite 并且效果很好。现在,我尝试将整个配置移动到新的(虚拟)服务器(相同的操作系统),但它不起作用。重写的目的是避免 URL 中的端口号(“:”)。这是我的 web.config 位于子文件夹 /834 中,因此用户可以输入 mysite/834 而不是 mysite:834。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="tp_redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{URL}" pattern=".+(834)/(.*)" />
</conditions>
<action type="Rewrite" url="http://teamplay.vps.mibosoft.se:{C:1}/{C:2}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
如前所述,此配置在我的旧服务器上运行良好。这是我在新服务器上所做的:
- 已安装 url 重写模块(也尝试重新安装)。
- 已安装 ARR(我需要这个吗?)。
有趣的是,如果我将 action type="Rewrite" 更改为 action type="Redirect",那么它可以工作,但我需要重写而不是重定向。两台服务器上的 WWWroot 结构相同。
这让我抓狂。有什么想法吗?
【问题讨论】:
-
没有提示?这是一个无声的论坛......
标签: iis url-rewriting