diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 0ffa883d8d..141fa337c4 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -117,18 +117,25 @@ namespace Volo.Docs.Pages.Documents.Project { return Redirect(decodedUrl); } - try - { - return await SetPageAsync(); - } - catch (DocumentNotFoundException exception) - { - Logger.LogWarning(exception.Message); + var documentNameFallback = DocumentName ?? ""; - DocumentFound = false; - Response.StatusCode = 404; - return Page(); + var documentNames = new[] { DocumentName, documentNameFallback.EnsureEndsWith('/') + "Index", documentNameFallback.EnsureEndsWith('/') + "index" }; + + foreach (var documentName in documentNames) + { + DocumentName = documentName; + try + { + return await SetPageAsync(); + } + catch (DocumentNotFoundException exception) + { + Logger.LogWarning(exception.Message); + } } + DocumentFound = false; + Response.StatusCode = 404; + return Page(); } private async Task SetPageAsync()