【发布时间】:2015-03-28 19:12:47
【问题描述】:
您好,我已经在我的 IIS 上配置了一个重写规则,但它似乎永远不会被解雇应用程序:
<rewrite>
<rules>
<rule name="Rewrite frienly url to snapshot" stopProcessing="true">
<match url="/(localhost:2934)\/trabajos\/([\w-]+)\/([\w-|\-]+)" />
<action type="Rewrite" url="\/snapshots/{R:2}.html" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
我的网址如下:
http://localhost:2934/trabajos/3ba2a9e4/some-cool-title '
我想改写为:
http://localhost:2934/snapshots/3ba2a9e4.html
这是我在 IIS 中测试模式得到的结果:
对我来说似乎没问题
但是在浏览器中测试 URL 时,我觉得规则永远不会被触发,事实上,我已经配置为跟踪失败的请求,如 this tutorial 并且我没有在日志文件夹中收到任何错误或文件. 例如:C:\inetpub\logs\FailedReqLogFiles
我收到了 404 错误,它的记录如下:
2015-03-28 18:56:11 ::1 GET /trabajos/3ba2a9e4/some-cool-tile - 2934 - ::1 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/42.0.2311.60+Safari/537.36 - 404 0 2 4
2015-03-28 18:56:15 ::1 GET /trabajos/3ba2a9e4/some-cool-title - 2934 - ::1 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/42.0.2311.60+Safari/537.36 - 404 0 2 2
有什么想法吗?
【问题讨论】:
标签: iis url-rewriting iis-8.5