vue-router history 模式 iis 配置

首先需要安装 url rewrite模块到IIS
点我安装

然后在web.config文件中添加如下配置

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
    <rule name="API Rule" stopProcessing="true">
      <match url="^(api|account|manage)(.*)$" />
      <action type="None" />
    </rule>
    <rule name="Angular Rule" 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/zzsdream/p/6576639.html
阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页