*: more hackdoc updates

Change-Id: Ib9830c66fe36c423d38f447905c470b67cde5399
diff --git a/devtools/hackdoc/main.go b/devtools/hackdoc/main.go
index 558268b..aae850f 100644
--- a/devtools/hackdoc/main.go
+++ b/devtools/hackdoc/main.go
@@ -111,7 +111,6 @@
 		return
 	}
 
-	glog.Infof("%+v", r.URL.Query())
 	ref := r.URL.Query().Get("ref")
 	if ref == "" {
 		ref = flagGitwebDefaultBranch
@@ -206,7 +205,7 @@
 		}
 
 		if file {
-			r.handleMarkdown(fpath, cfg)
+			http.Redirect(r.w, r.r, "/"+fpath, 302)
 			return
 		}
 	}
@@ -238,13 +237,18 @@
 	if file {
 		parts := strings.Split(r.rpath, "/")
 		dirpath := strings.Join(parts[:(len(parts)-1)], "/")
+		// TODO(q3k): figure out this hack, hopefully by implementing a real path type
+		if dirpath == "/" {
+			dirpath = "//"
+		}
+
 		cfg, err := config.ForPath(r.ctx, r.source, dirpath)
 		if err != nil {
 			glog.Errorf("could not get config for path %q: %w", dirpath, err)
 			r.handle500()
 			return
 		}
-		r.handleMarkdown(r.rpath, cfg)
+		r.handleFile(r.rpath, cfg)
 		return
 	}