0

I Had a problem with 404 while the application starts and accessed http://test.com/t1. So I have added the below rule for resolving the issue. Now I am getting 404 when refresh the screen at http://test.com/t1 after loading. Please suggest

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="AngularJS Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="(.*)" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
iluv_dev
  • 135
  • 1
  • 11

1 Answers1

1

Based on your description, it looks like you are using rewrite rules in your web config to handle routing for your AngularJS application.

I suggest you clear your browser cache before accessing the URL, the 404 error you encountered again may be affected by the browser cache.

If clearing your browser cache doesn't solve the problem, if clearing the browser cache does not solve the problem, try changing the rule to serve the main HTML file for all non-existing paths.

<action type="Rewrite" url="/index.html" />

Alternatively, you can also try using FRT to view details about the 404 error, which will generate a detailed log file to help you identify the problem.

Troubleshoot failed requests using tracing in IIS 7

Similar threads:

How do I configure IIS for URL Rewriting an AngularJS application in HTML5 mode?

Do we really need URL Rewrite module for hosting angular app on IIS?

YurongDai
  • 1,362
  • 1
  • 2
  • 7