angular当router使用userhash:false时路由404问题
安装iis urlrewrite2.0组件
在根目录下创建 Web.config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
原文地址:https://www.cnblogs.com/francis67/p/10350018.html
时间: 2024-10-13 15:13:53