1111``makeabilitylab.cs.washington.edu`` in prod, ``makeabilitylab-test...`` on the
1212test server, and ``localhost`` in dev — no per-environment configuration.
1313
14+ Scheme handling: the ``<loc>`` protocol comes from ``request.scheme``. Behind
15+ UW CSE's TLS-terminating Apache proxy that is now ``https`` because
16+ ``SECURE_PROXY_SSL_HEADER`` trusts the proxy's ``X-Forwarded-Proto`` header
17+ (#1329); in local dev it is ``http``. We previously pinned ``protocol="https"``
18+ to paper over Django seeing ``http`` behind the proxy — that workaround is gone
19+ now that the scheme is correct at the framework level.
20+
1421We map only the pages that have real, indexable URLs:
1522 - static listing pages (home, people, publications, projects, awards, news)
1623 - one entry per visible Project -> /project/<short_name>/
@@ -37,22 +44,7 @@ def _latest(model, field):
3744 )
3845
3946
40- class _HttpsSitemap (Sitemap ):
41- """
42- Base sitemap that pins generated URLs to the https scheme.
43-
44- Apache terminates TLS and proxies to Django over plain HTTP, so the
45- request scheme Django sees is ``http``. Without this, RequestSite would
46- emit ``http://`` <loc> URLs that only 302-redirect to https — making the
47- sitemap advertise non-canonical URLs with an extra hop. Pinning the
48- protocol here makes every sitemap list the canonical https URLs directly.
49- (Cosmetic only in local dev, where the site is served over http.)
50- """
51-
52- protocol = "https"
53-
54-
55- class StaticViewSitemap (_HttpsSitemap ):
47+ class StaticViewSitemap (Sitemap ):
5648 """Top-level listing pages that aren't tied to a single model instance."""
5749
5850 changefreq = "weekly"
@@ -106,7 +98,7 @@ def lastmod(self, item):
10698 return None
10799
108100
109- class ProjectSitemap (_HttpsSitemap ):
101+ class ProjectSitemap (Sitemap ):
110102 """Public project pages: /project/<short_name>/."""
111103
112104 changefreq = "weekly"
@@ -127,7 +119,7 @@ def lastmod(self, obj):
127119 return obj .updated
128120
129121
130- class PersonSitemap (_HttpsSitemap ):
122+ class PersonSitemap (Sitemap ):
131123 """Public people pages: /member/<url_name>/."""
132124
133125 changefreq = "monthly"
@@ -153,7 +145,7 @@ def lastmod(self, obj):
153145 return obj .bio_datetime_modified
154146
155147
156- class NewsSitemap (_HttpsSitemap ):
148+ class NewsSitemap (Sitemap ):
157149 """News item pages: /news/<slug>/."""
158150
159151 changefreq = "monthly"
0 commit comments