I have an Umbraco 6.4 website, under which I am now trying to put an AngularJS 2 SPA.
Umbraco: /
Angular: /appname
My problem is with the routing that is done by Umbraco. Since Umbraco handles all of the routing up to the root level, when the Angular app gets refreshed: /appname/apage
I get a 404 - Not Found
.
I have added a URL rewrite in the UrlRewriting.config
, however I have done it in a way that the destination url is always the index.html
file.
<add name="myapp" virtualUrl="^~/myapp/*" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/myapp/index.html" ignoreCase="true" />
What I would like to be able to do is define a rewrite which lets me override the Umbraco routing whenever the path begins with /myapp/
.
I have read this blog post, but it doesn't really relate to my problem because the way I have built my SPA, it doesn't have anything to do with Umbraco. Also, I must have Umbraco as the root directory, and therefore I cannot rely on IIS to do this for me either.
It would be great if someone, anyone, could point me in the direction. Thanks