vue-router history 模式 iis 配置

vue

首先需要安装 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>

 

以上是 vue-router history 模式 iis 配置 的全部内容, 来源链接: utcz.com/z/380510.html

回到顶部