Web.config 重写规则导致错误“页面的相关配置数据无效”

use*_*392 4 asp.net asp.net-mvc wcf asp.net-web-api

我收到错误“无法访问请求的页面,因为该页面的相关配置数据无效。” 当我在 WCF 应用程序的 web.config 中使用重写元素时。

<rewrite>
  <rules>
    <rule name="Rewrite Index">
      <match url="myApplicaiton/Healthcheck.aspx" />
      <action type="Redirect" url="HealthCheck.aspx" />
    </rule>
  </rules>
</rewrite>  
Run Code Online (Sandbox Code Playgroud)

如果请求 url 包含“myApplication” http://localhost/myApplication/HealthCheck.aspx我想要重定向(服务器重定向)。您能否告诉我上述配置是否有任何问题,并让我知道是否有其他方法对 WCF 应用程序 web.config 中的静态文件进行重定向

小智 6

你应该安装Url Rewrite extension在你的iis中。

https://www.iis.net/downloads/microsoft/url-rewrite