Skip to content
Snippets Groups Projects
Unverified Commit 46f563b5 authored by Max Adamo's avatar Max Adamo
Browse files

fix redirect

parent a6880e77
Branches
Tags
No related merge requests found
...@@ -48,8 +48,10 @@ func renderPage(w http.ResponseWriter, req *http.Request) { ...@@ -48,8 +48,10 @@ func renderPage(w http.ResponseWriter, req *http.Request) {
} }
// function redirect // function redirect
func redirect(w http.ResponseWriter, r *http.Request) { func redirect(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, r, "/by_name.html", http.StatusMovedPermanently) redirectURL := filepath.Join(req.URL.Path, "/by_name.html")
fmt.Printf("test %s\n", redirectURL)
http.Redirect(w, req, redirectURL, http.StatusMovedPermanently)
} }
func main() { func main() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment