Broken links when using the footer from the Docs site
On the page https://docs.djangoproject.com/foundation/donate/, the "get in touch" links under the following two sections are broken:
- "Do you accept donations from companies/corporations?"
- "Can I choose a specific feature or project to support?"
Both point to https://docs.djangoproject.com/contact/foundation/, which returns a 404.
Edit: it appears it should be pointing to https://www.djangoproject.com/contact/foundation/, so using the www subdomain, rather than the docs subdomain, while the link is relative (<a href="/contact/foundation/">).
Upon further investigation, I believe that this page should not be accessed on the docs subdomain at all.
If you open the Django website (https://www.djangoproject.com/), everything works as expected.
However, if you open https://docs.djangoproject.com/en/5.1/, the link Benevity Workplace Giving Program in the footer, using a relative URL, links to https://docs.djangoproject.com/foundation/donate/#benevity-giving
I guess the fix is to ensure the footer link uses the absolute URL, including the host (and potentially adding a redirect to the www subdomain for docs.djangoproject.com/foundation/ to preserve existing links).
Also when clicking the Corporate Membership links in the footer.
https://github.com/django/djangoproject.com/blob/20cec4557cf4a2d92e8bce48c7426607d32f3c83/djangoproject/templates/includes/footer.html#L60-L62
I think this was reported before as #1590, but your issue has more information so I'll keep this one open and close the other.
As you pointed out, this has to do with the django-hosts setup and some links being domain-relative when they should be absolute.
I'm not too familiar with how django-hosts works, but I think using { url ... %} in the templates (rather than hardcoding the URL) should work to fix this issue. I don't know if that's even possible, but it would be nice to be able to check if there are similarly broken links in other templates 🤔
Hi @bmispelon ,
I’d like to work on this issue. Just to confirm, should I proceed with updating the links using { url ... %} in the templates, or is there another preferred approach?
Thanks!