我想将大华 ANPR 相机的两个 POST 请求重定向到 Microsoft IIS 中的一个脚本。我想将 POST 请求从“http://localhost/NotificationInfo/KeepAlive”和“http://localhost/NotificationInfo/TollgateInfo”重定向到“http://localhost/anpr/”。我在主配置文件“C:\inetpub\wwwroot\web.config”中创建了规则:
<rules>
<rule name="NotificationInfo/TollgateInfo" patternSyntax="ECMAScript">
<match url="(.*)/NotificationInfo/TollgateInfo" ignoreCase="false" />
<action type="Rewrite" url="{R:1}/anpr/" appendQueryString="false" logRewrittenUrl="true" />
</rule>
<rule name="NotificationInfo/KeepAlive">
<match url="(.*)/NotificationInfo/KeepAlive$" />
<action type="Rewrite" url="{R:1}/anpr/" logRewrittenUrl="true" />
</rule>
<rule name="NotificationInfo/TollgateInfo/" patternSyntax="ECMAScript">
<match url="(.*)/NotificationInfo/TollgateInfo/" ignoreCase="false" />
<action type="Rewrite" url="{R:1}/anpr/" appendQueryString="false" logRewrittenUrl="true" />
</rule>
<rule name="NotificationInfo/KeepAlive/">
<match url="(.*)/NotificationInfo/KeepAlive/$" />
<action type="Rewrite" url="{R:1}/anpr/" logRewrittenUrl="true" />
</rule>
</rules>
IIS 10 为“http://localhost/NotificationInfo/KeepAlive”和“http://localhost/NotificationInfo/TollgateInfo”返回错误“HTTP 404.0 — 未找到”。地址“http://localhost/anpr/”有效。 “anpr”是一个带有脚本“index.php”的文件夹。我做错了什么?如何进行这种重定向?如何执行重写规则以从“http://localhost/NotificationInfo/KeepAlive”和“http://localhost/NotificationInfo/TollgateInfo”重定向到“http://localhost/anpr/”?你能帮我吗?