Reputation: 21
I have created a Virtual Directory on IIS (inetmgr) on my local PC and later converted it into IIS Web Application. The web application's root is: http://localhost/xyz/ When deployed and ran the application, I get the following error in the browser:
All html components 404 not found errors.
Added rewrite rules in web.config. I changed index.html's base href to ./xyz or ./ but no luck.
If I deploy it to root directory, everything resolves - not sure what's going wrong.
Upvotes: 0
Views: 1860
Reputation: 961
xyz
folder as a web application folder (See below picture)<base href="/spa/">
<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" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
Hope it helps!
Upvotes: 1