繁体   English   中英

在ASP.NET中重写规则

[英]Rewrite Rule In ASP.NET

我在单页应用程序的IIS中使用重写规则,并使用angular ui路由器为我的项目提供服务,但是当我向api服务发送请求时,它不会调用它并重定向到我在规则操作和响应返回中放入的页面HTML格式的HTML页面(单页正文)返回给我,而不是我希望通过使用服务获得所需的数据。

<rule name="HomeRule" stopProcessing="true">
    <match url="po" ignoreCase="true" />  
      <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
      </conditions> 
      <action type="Rewrite" url="/Pages/MasterPage.html" />
  </rule> 

请任何人解决此问题,谢谢

看看这是什么意思。

<conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions> 

使用MatchAll逻辑分组时,俗话说只有文件名不是directory ,也不是filename ,才执行规则。 那是你真正想要的吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM