From ae1c8c5555c66ac00c713167067d946e08652816 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 29 Sep 2024 13:25:42 +0200 Subject: Added / -> /ideas/ redirection --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index b8aef22..b29b8eb 100644 --- a/main.go +++ b/main.go @@ -178,6 +178,10 @@ func main() { fs := http.FileServer(http.Dir("assets/")) mux.Handle("/static/", http.StripPrefix("/static/", fs)) + mux.HandleFunc("GET /{$}", func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, "/ideas/", http.StatusMovedPermanently) + }) + mux.HandleFunc("GET /ideas/", func(w http.ResponseWriter, r *http.Request) { tmpl.Execute(w, PageData{Ideas, ""}) }) -- cgit v1.2.3