diff --git a/mercurial/templates/json/map b/mercurial/templates/json/map
index 81e0955ca2fd149ad0cc646f18c53f90da578d3f_bWVyY3VyaWFsL3RlbXBsYXRlcy9qc29uL21hcA==..59058549a611342f16e6d7e4a99b9e6ea40fa322_bWVyY3VyaWFsL3RlbXBsYXRlcy9qc29uL21hcA== 100644
--- a/mercurial/templates/json/map
+++ b/mercurial/templates/json/map
@@ -114,7 +114,8 @@
 archiveentry = '\{
   "node": {node|json},
   "extension": {extension|json},
-  "type": {type|json}
+  "type": {type|json},
+  "url": {"{urlbase}{url}archive/{node}{extension}"|json}
   }'
 filediff = '\{
   "path": {file|json},
diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t
index 81e0955ca2fd149ad0cc646f18c53f90da578d3f_dGVzdHMvdGVzdC1oZ3dlYi1qc29uLnQ=..59058549a611342f16e6d7e4a99b9e6ea40fa322_dGVzdHMvdGVzdC1oZ3dlYi1qc29uLnQ= 100644
--- a/tests/test-hgweb-json.t
+++ b/tests/test-hgweb-json.t
@@ -806,7 +806,8 @@
       {
         "extension": ".tar.bz2",
         "node": "tip",
-        "type": "bz2"
+        "type": "bz2",
+        "url": "http://*:$HGPORT/archive/tip.tar.bz2" (glob)
       }
     ],
     "bookmarks": [