ASP.Net Core Rewrite rule for Aurelia bookmarks

I am running into an issue with ASP.Net web app returning 404 for any page other then / or /index.html, say for instance
What is funny is it works locally on the dev server for any page you pass, but when I move it over to the Azure slot no deep links for book marks not at the root work.

I have a rewrite rule in place for using Auth0’s callback mechanism like this:

<rule name="redirect all requests" stopProcessing="true">
                     <match url="^(.*callback*)$" ignoreCase="false" />
                     <action type="Rewrite" url="index.html" appendQueryString="true" />

And I found this blog but it restructured the site for it to work:

Is there an easier way to get the redirect back to the Aurelia SPA for deep links?


It appears that it was a simple configuration in startup.cs Configure() that did the trick for me.

Order is critical to get it to work.
Here is how mine is laid out:

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)

            //if (env.IsDevelopment())



            app.UseStatusCodePagesWithReExecute("/"); //<- This made it work, no other configuration used