I have an issue with URL rewriting in asp.net core 3 using static files. So I want to rid of .html extension in URL.
My launchSettings.json looks like this:
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "DemoSignUp.html",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
So to rewrite it to "DemoSignUp" I added these lines of code in my Startup.cs:
app.UseRewriter(new RewriteOptions()
.AddRedirect("DemoSignUp.html", "DemoSignUp")
.AddRewrite("DemoSignUp", "DemoSignUp.html", skipRemainingRules: false));
But my URL still have .html extension
https://localhost:44319/DemoSignUp.html