jac*_*per 0 iis url-rewriting iis-8.5
嗨,我已经在我的 IIS 上配置了一个重写规则,但它似乎永远不会被触发我已经为此工作了几个小时但没有任何运气这是我在应用程序的Web 配置中的规则:
<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>
Run Code Online (Sandbox Code Playgroud)
我的网址如下:
http://localhost:2934/trabajos/3ba2a9e4/some-cool-title '
我想重写为:
http://localhost:2934/snapshots/3ba2a9e4.html
这是我在 IIS 中测试模式得到的结果:

对我来说似乎没问题
但是在浏览器中测试 URL 时,我觉得规则永远不会被触发,事实上,我已经配置为跟踪失败的请求,就像本教程一样,我没有在日志文件夹中收到任何错误或文件。例如: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
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我有同样的问题,在 IIS 中设置 URL 重写规则后出现 404 错误。最后我发现我需要通过单击以下项目来打开反向代理。