implement / redirect

This commit is contained in:
mappu 2017-07-11 18:36:14 +12:00
parent 3a421829f1
commit 308aa11bf0

View File

@ -91,6 +91,9 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
this.routeIndex(w, r) this.routeIndex(w, r)
return return
} else if remainingPath == "" {
this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.QueryEscape(this.opts.DefaultPage))
return
} else if strings.HasPrefix(remainingPath, "view/") { } else if strings.HasPrefix(remainingPath, "view/") {
articleTitle, err := url.QueryUnescape(remainingPath[len("view/"):]) articleTitle, err := url.QueryUnescape(remainingPath[len("view/"):])