Remove the link from the template as there no real way to have it always be correct.
--- a/templates/notfound.tmpl
+++ b/templates/notfound.tmpl
@@ -7,6 +7,6 @@
The specified repository "#repo#" is unknown, sorry.
-Go back to main page, please click <a href="/hg">here</a>
+Please go back to the main repository list page.
#footer#