aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/site/fs.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/site/fs.go b/pkg/site/fs.go
index 6a3b1d6..11b36cf 100644
--- a/pkg/site/fs.go
+++ b/pkg/site/fs.go
@@ -50,6 +50,10 @@ func (fs *SiteFileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if info.IsDir() {
+ if !strings.HasSuffix(path, "/") {
+ http.Redirect(w, r, path+"/", http.StatusTemporaryRedirect)
+ return
+ }
indexPath := filepath.Join(path, "index.html")
if file, err = fs.root.Open(indexPath); os.IsNotExist(err) {
if fs.siteConfig.Flags&config.FlagIndex == 0 {