I'm not sure whether my question relates to the initial question, but perhaps it makes sense when subrouters are used? Consider this:
router.Route("/{username}", func(r chi.Router) {
r.Get("/", func(w http.ResponseWriter, request *http.Request) {
// r.Redirect("/details") <---- This is where I want to redirect to, keeping the subrouter's prefix (/{username}).
})
r.Get("/details", func(writer http.ResponseWriter, request *http.Request) {
// ... <---- Redirects here
})
}
Commented here, but since the issue cannot be reopened, I opened this issue to continue the discussion.
Copy of my comment there:
Originally posted by @shamilovstas in #709