After hosting Angular2 app on IIS direct url is not working : <p>We have developed Angular2 App.</p>

<p>It is working fine while we are running under angular-cli with 'ng serve'.</p>

<p>Once we host the app to IIS 7.5, we can browse to root of the app without much of the problem and we can navigate to whatever other views from app navigation created.</p>

<p>But issue starts when user try to load url which is targeting specific route or component.</p>

<p>so if we go to <strong><a href="http://serverurl" rel="noreferrer">http://serverurl</a></strong> ... it loads <strong>index.html</strong> and then clicking on navigation link on index.html it takes user to <strong><a href="http://serverurl/route1/component1" rel="noreferrer">http://serverurl/route1/component1</a></strong></p>

<p>But when user tries to go to url <strong><a href="http://serverurl/route1/component1" rel="noreferrer">http://serverurl/route1/component1</a></strong> directly by typing <strong><a href="http://serverurl/route1/component1" rel="noreferrer">http://serverurl/route1/component1</a></strong> in browser address bar, it is sending that request to IIS, and that returns and error with resource not found.</p>

<p>And it is easy to understand, that url is not exists on server. That is angular url. Ideally, it should load <strong>index.html</strong> and pass rest of the url to angular router and load that <strong>/route1/component1</strong>. And that works with 'ng serve' but does not work with IIS 7.5. Is there any settings I have to do in IIS to get it working ? Or in anything I have to do in Anuglar2 App ?</p>

<p>Can anyone suggest me how to get this fixed?</p>
