Skip to content

Commit

Permalink
add redirect for /insights/* to /blog/*
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarfors committed Sep 8, 2024
1 parent 5941c2c commit 6aa5ce0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,16 @@ func Run(ctx context.Context, site Site) error {
)
return
}
// Handle /insights/ which was where we hosted the blog before.
router.Get("/insights/*", func(w http.ResponseWriter, r *http.Request) {
wildcard := chi.URLParam(r, "*")
http.Redirect(
w,
r,
"/blog/"+wildcard,
http.StatusMovedPermanently,
)
})
w.WriteHeader(http.StatusNotFound)
pageInfo := PageInfo{
RequestURI: r.RequestURI,
Expand Down

0 comments on commit 6aa5ce0

Please sign in to comment.