summaryrefslogtreecommitdiff
path: root/rewrite.go
blob: ba237929bbc8b2da4c0dedef2d4b12736fc9221d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Register HTTP handlers that redirect old blog paths to their new locations.

package main

import "net/http"

func init() {
	for src, dst := range urlMap {
		http.HandleFunc(src, func(w http.ResponseWriter, r *http.Request) {
			http.Redirect(w, r, dst, http.StatusPermanentRedirect)
		})
	}
}

var urlMap = map[string]string{
	"/whoami": "/Who-am-I",
	"/tek":    "/teapot",
}