[#8477] added optional argument for macro canonical_tag to completely ignore the page param
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index 1a47884..9e1d348 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -883,9 +883,11 @@
     {%- do g.register_forge_js('js/prop-types.min.js', location=location) %}
 {%- endmacro %}
 
-{% macro canonical_tag(page=None) %}
+{% macro canonical_tag(page=None, ignore_page=False) %}
     {% if not page and not 'page=' in request.query_string  %}
         <link rel="canonical" href="{{ request.path_url }}" />
+    {% elif not page and ignore_page %}
+        <link rel="canonical" href="{{ request.path_url }}" />
     {% else %}
         {#  in case is inherithed from a child template and has no access to a page value #}
         {% set page = request.GET['page'] if not page and 'page=' in request.query_string else page  %}
diff --git a/Allura/allura/templates/repo/tree.html b/Allura/allura/templates/repo/tree.html
index d4cc8d8..ebe8df5 100644
--- a/Allura/allura/templates/repo/tree.html
+++ b/Allura/allura/templates/repo/tree.html
@@ -19,6 +19,10 @@
 {% extends 'allura:templates/repo/repo_master.html' %}
 {% do g.register_forge_css('css/forge/hilite.css') %}
 
+{% block head %}
+    {{ canonical_tag(ignore_page=True) }}
+{% endblock %}
+
 {% block title %}
   {{c.project.name}} / {{c.app.config.options.mount_label}}
     / {{commit.shorthand_id()}} {{path}}