规则是
<rule name="Redirect to new host" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_URI}" pattern=".*mycompany\.com/blogs(.*)" />
</conditions>
<action type="Redirect" url="http://blogs.mycompany.com{C:1}" />
</rule>
模块的内置模式测试器表示http://subdomain.mycompany.com/blogs/blog1匹配,因此它应该重定向到http://blogs.mycompany.com/blog1,但没有任何反应。非常感谢帮助修复此规则或编写一个有效的规则!
答案 0 :(得分:0)
这是工作:
<rule name="Test" stopProcessing="true">
<match url=".*" />
<conditions trackAllCaptures="true">
<add input="{HTTP_HOST}" pattern="^.*mycompany\.com$" />
<add input="{URL}" pattern="^/blogs(.*)$" />
</conditions>
<action type="Redirect" url="http://blogs.mycompany.com{C:1}" />
</rule>