77 字
1 分钟
VueRouter history mode iis config
配置web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".woff" mimeType="font/x-font-woff" /> </staticContent> <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.config.js 中 publicPath 修改为 './'**
VueRouter history mode iis config
https://kuriyama.top/posts/vue/vue-router-history-mode-iis-config/