I'm trying to set Core MVC Rewrite so:
- when
localhost/part
is requested, it responds with the defaultlocalhost/part/index.html
- when
localhost/part/[anything]
, then still responds withindex.html
(localhost/part/index.html
)
Here's what I have now:
app.UseRewriter(new RewriteOptions().AddRewrite("part(\\/.*)?", "part/index.html", true)); app.UseDefaultFiles(); app.UseStaticFiles(); app.UseIdentity(); app.UseMvc(...);
So now, when
localhost/part/[anything]/[something]is requested, it does serve
index.html. But it serves it as
localhost/part/[anything]/[something]/index.htmland this is a problem with Angular's BASE_HREF. So app showsLoading... and nothing else is loaded obviously. Hm... This requires a fix from Angular's part. And I have no idea for the fix right now. Anyone?