From 308aa11bf05c613feac84a8bbd456b1fceac50ef Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 11 Jul 2017 18:36:14 +1200 Subject: [PATCH] implement / redirect --- WikiServer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WikiServer.go b/WikiServer.go index 8523dfe..ed58522 100644 --- a/WikiServer.go +++ b/WikiServer.go @@ -91,6 +91,9 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { this.routeIndex(w, r) return + } else if remainingPath == "" { + this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.QueryEscape(this.opts.DefaultPage)) + return } else if strings.HasPrefix(remainingPath, "view/") { articleTitle, err := url.QueryUnescape(remainingPath[len("view/"):])