Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package redirect
import (
func init() {
http.HandleFunc("/", handler)
func handler(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, ""+r.URL.RequestURI(), http.StatusMovedPermanently)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.