I use ASP.NET 5, where the entire folder structure is changed and replaced by web.config (compared to previous versions of ASP.NET). I am doing client-side routing using angularJS and I have this route:
.when('/movies/add', { templateUrl: '/Views/add.html', controller: 'MoviesAddController' })
Everything works as long as I start with my index.html and click on the link to / movies / add. If I reload the page using the / movies / add URL, the server gives me 404. According to this tutorial, I have to rewrite it in web.config, for example:
<configuration> <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <rewrite> <rules> <rule name="Index Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_URI}" matchType="Pattern" pattern="^/api/" negate="true" /> </conditions> <action type="Rewrite" url="/index.html" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
I am using IIS Express 10.0 (in preview of Windows 10). I understand that the part in web.config must still exist in ASP.NET 5 to configure IIS, but I am not getting any result from this. Do I need to do something using IIS Express? Is there any other, more general solution provided in ASP.NET 5?
Thanks!
source share