Vue-router的history模式下 如何配置iis服務器?

1.安裝url-rewrite擴展 點擊前往

2.創建一個web.config文件,內容以下:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="fixhtml5mode" stopProcessing="true">
                    <match url="^((?!blog)(?!api).)*$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/" />
                </rule>
            </rules>
        </rewrite>
        <staticContent>
            <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
        </staticContent>
    </system.webServer>
</configuration>
複製代碼

引自:forum.vuejs.org/t/vue-route… 感謝~html

相關文章
相關標籤/搜索