Url rewriting 为什么赢了';这不是URL重写规则吗?
规则是Url rewriting 为什么赢了';这不是URL重写规则吗?,url-rewriting,iis-7.5,url-rewrite-module,Url Rewriting,Iis 7.5,Url Rewrite Module,规则是 <rule name="Redirect to new host" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{REQUEST_URI}" pattern=".*mycompany\.com/blo
<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>
匹配,所以它应该重定向到,但什么也没有发生。如果您能帮助修复此规则或编写一个有效的规则,将不胜感激 这是工作:
<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>
我完全愿意接受,但将输入更改为{URL},规则仍然无法启动。即使内置的模式测试仪说它匹配(再次,像以前一样…嗯,感觉测试仪一点都不值钱)。