package main import ( "fmt" "net/http" ) func redirectToImuslab(w http.ResponseWriter, r *http.Request) { fmt.Println(r.RequestURI) w.Header().Set("Location", "https://imuslab.com") w.WriteHeader(http.StatusTemporaryRedirect) w.Write([]byte("Redirecting to imuslab")) } func listindex(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello World")) } func main() { http.HandleFunc("/test", redirectToImuslab) fmt.Println("Listeing on :8080") http.ListenAndServe(":8080", nil) }