Does anyone has any experience of hosting Angular 2 website in an IIS application (not Site)? I created an Angular 2 app with base href of "/" in my index.html and all my routing is on base level. As shown in the picture below, my app is now hosted in the BuildingProjects site (the one that is stopped). However I'm trying to host it under the Default Web Site in de BuildingProjects application. I tried to change the base href as shown below, but then all my routing to next components fails. The extra pitfall is that the app is authentication over AzureAD. The reply URL is set to .../Test/BuildingProjects/id_token, but this gives me the message that there is a wrong reply URL.
<base href="/"> --> <base href="/Test/BuildingProjects/">
RouterModule.forRoot([
{ path: 'id_token', component: OAuthCallbackComponent, canActivate: [OAuthCallbackHandler] }, // reply URL AAD
{ path: 'projects', component: ProjectsComponent, canActivate: [AuthenticationGuard] },
{ path: 'login', component: LoginComponent },
{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: 'loading', component: OAuthCallbackComponent }
]),
I tried everything to put the custom base path in the routes in every kind of combination, but without any succes.
EDIT
Also tried
base href="//"
Web.config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" >
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>