diff --git a/dict/main.go b/dict/main.go index c240895..08a754b 100644 --- a/dict/main.go +++ b/dict/main.go @@ -138,6 +138,11 @@ func main() { func(w http.ResponseWriter, r *http.Request) any { return nil }, []string{http.MethodGet}, )) + redirectToHome := func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, "/", http.StatusPermanentRedirect) + } + r.HandleFunc("/search", redirectToHome) + r.HandleFunc("/search/", redirectToHome) r.HandleFunc("/search/{query}", httputils.GenerateHandler( "index.html", func(w http.ResponseWriter, r *http.Request) bool {