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>
 

posted on 2017-03-18 23:04  zhangzongshan  阅读(3462)  评论(0编辑  收藏  举报

导航