IIS刷新404解决方法

安装URLWrite后,web.config添加如下配置

 <system.webServer>
    <rewrite>
      <rules>
        <rule name="Handle History Mode and custom 404/500" 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>

nginx/apache配置见如下博文

Vue项目部署Apache刷新404问题解决 – KnifeZ

nginx配置vue项目刷新404问题 – KnifeZ