For us angular app is working without URL rewrite module installed on IIS. Do we need URL rewrite module to host angular app on IIS? What difference it will make if we don't install that?
It works with below web.config..I just commented rewrite part and added
default document
<?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="/SCOAP/index.html" />
</rule>
</rules>
</rewrite> -->
<defaultDocument enabled="true">
<files>
<add value="index.html" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Angular is mostly used for writing SPAs. So you will probably have '/home', '/products' and other urls that should run the same angular application but just different content will be rendered by your app. So when user navigates to 'yoursite.com/home' it should see Angular app home page. and witout rewrites you will see just 404 (because no /home.html lies in sources)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With