diff --git a/core/router/fs.go b/core/router/fs.go index 5cb6f6f7..182e197a 100644 --- a/core/router/fs.go +++ b/core/router/fs.go @@ -284,7 +284,7 @@ func FileServer(fs http.FileSystem, options DirOptions) context.Handler { // index requested, send a moved permanently status // and navigate back to the route without the index suffix. - if !noRedirect && strings.HasSuffix(name, options.IndexName) { + if !noRedirect && options.IndexName != "" && strings.HasSuffix(name, options.IndexName) { localRedirect(ctx, "./") return }