Dear All,
I have build one small project using Angular 6 and ASP .Net MVC 5 with Rest Api and deployed on IIS.
I am not able to refresh my web pages, if I do that then I am getting error of 404.
To overcome on this problem I get come to kow that I should use URL rewrite and web.config.
If I use following web.config with Angular 6 prod files then I can able to refresh to all pages but it produces another error i.e. related to CORS.
Here is follwing my web.config :-
- <?xml version="1.0" encoding="utf-8"?>
- <configuration>
-
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="Angular Routes" 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="./index.html" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
-
- </configuration>
How can I overcome on above problem.
Please let me any easy solution.
Thanking you in advanced,
Regards.