From 5785dc19d763fd751e0ab22b6c6d09975bafe758 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 3 Oct 2013 13:41:38 -0400 Subject: [PATCH] godoc: redirect bogus /doc/spec links to /ref/spec It was not enough to make /ref/spec work (which it now does), because some of the docs on golang.org (in particular golang.org/doc) are pulled from tip, and tip links to /doc/spec now. Make those "too new" links work by redirecting /doc/spec back to /ref/spec for now. TBR=adg CC=golang-dev https://golang.org/cl/14348043 --- godoc/redirect/redirect.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/godoc/redirect/redirect.go b/godoc/redirect/redirect.go index fc8de6a7..1ad8d12c 100644 --- a/godoc/redirect/redirect.go +++ b/godoc/redirect/redirect.go @@ -90,12 +90,20 @@ var redirects = map[string]string{ "/issue/new": "https://code.google.com/p/go/issues/entry", "/issues": "https://code.google.com/p/go/issues", "/play": "http://play.golang.org", + // THESE DO NOT WORK FOR GO 1.1 SITES SUCH AS golang.org. // DO NOT RE-ENABLE. // "/ref": "/doc/#references", // "/ref/": "/doc/#references", // "/ref/mem": "/doc/mem", // "/ref/spec": "/doc/spec", + + // In fact, becuase golang.org pulls some pages from tip, there + // are already links on the main golang.org page pointing at + // the non-existent /doc/spec etc URLs. So redirect the other way. + "/doc/mem": "/ref/mem", + "/doc/spec": "/ref/spec", + "/talks": "http://talks.golang.org", "/tour": "http://tour.golang.org", "/wiki": "https://code.google.com/p/go-wiki/w/list",