© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
23 replies
Gopher

UseStaticFiles for HTML

I have generated a Static WebApp from my Markdown Files.
app.UseStaticFiles(new StaticFileOptions
{
    FileProvider = new PhysicalFileProvider(Path.Combine(builder.Environment.ContentRootPath, "Documentation")),
    RequestPath = "/docs",
});
app.UseStaticFiles(new StaticFileOptions
{
    FileProvider = new PhysicalFileProvider(Path.Combine(builder.Environment.ContentRootPath, "Documentation")),
    RequestPath = "/docs",
});

I want this to serve the File "Documentation/Userguide.html" if the route is "/docs/Userguide"

If i serve it via NGNIX i would configure something like this
 location / {
        try_files $uri $uri.html $uri/ =404;
 }
 location / {
        try_files $uri $uri.html $uri/ =404;
 }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Parsing a Link from an HTML file with HTMLAgilityPack
C#CC# / help
3y ago
❔ @Html.DropDownListFor results in null for selected item
C#CC# / help
3y ago