aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-29 13:25:42 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-29 13:25:42 +0200
commitae1c8c5555c66ac00c713167067d946e08652816 (patch)
treeb9a3af16c503946efcca9f7a7c641ebcdd92e2a0
parent07ace53ba2423f1b7e62477549ba62a30e79ff47 (diff)
Added / -> /ideas/ redirection
-rw-r--r--main.go4
1 files changed, 4 insertions, 0 deletions
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, ""})
})