这是请求:
http://localhost:8080/angular/angular-loading-bar/0.9.0/loading-bar.min.css
我希望将其重写为:
!
仅更改,开头的 <system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes 1" stopProcessing="true">
<match url="!\/(\S+)" />
<action type="Rewrite" url="/{R:1}" />
</rule>
<rule name="AngularJS Routes1" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
将被删除。
这是我使用的模式:
<div *ngFor="let l of listings | slice:0:2 | filterByStatus:'ACTIVE' ">
<listing-item [listing]="l"></listing-item>
</div>
有趣的是,虽然安装并启用了UrlRewriting模块,但它可以与IIS Express配合使用,但不适用于IIS 10。 甚至,在IIS的入站规则部分下,当我测试url时,它会按预期给出输出(删除&#34;!&#34;)。但是当我运行网站时它不起作用。
答案 0 :(得分:1)
基于我们在聊天中与@Jude的讨论:
出于某种原因,IIS在IIS中没有RewriteModule
。
修复URL重写模块帮助:
转到“控制面板” - &gt;程序和功能。查找URL重写并修复它