Refreshing page gives “Page not found”

后端 未结 7 2052
夕颜
夕颜 2020-11-29 02:08

I have an app where it uses a single ng-view and multiple controllers and views. If I navigate through the root, eg: www.domain.com, everything works. Except that if I hit

相关标签:
7条回答
  • 2020-11-29 02:38

    this is the .NET version of URL rewrite (IIS)

    <system.webServer>
        <rewrite>
          <!--This directive was not converted because it is not supported by IIS: RewriteBase /.-->
          <rules>
            <rule name="Imported Rule 1" stopProcessing="true">
              <match url="^index\.html" ignoreCase="false" />
              <action type="None" />
            </rule>
            <rule name="Imported Rule 2" stopProcessing="true">
              <match url="." ignoreCase="false" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
              </conditions>
              <action type="Rewrite" url="/index.html" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    
    0 讨论(0)
提交回复
热议问题