Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken links when using the footer from the Docs site #1880

Open
pbratkowski opened this issue Jan 19, 2025 · 3 comments
Open

Broken links when using the footer from the Docs site #1880

pbratkowski opened this issue Jan 19, 2025 · 3 comments

Comments

@pbratkowski
Copy link
Contributor

pbratkowski commented Jan 19, 2025

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/">).

@pbratkowski
Copy link
Contributor Author

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).

@pbratkowski pbratkowski changed the title Broken links on Donate page Broken links when using the footer from the Docs site Jan 19, 2025
@pbratkowski
Copy link
Contributor Author

Also when clicking the Corporate Membership links in the footer.

<li><a href="/foundation/corporate-membership/">Corporate membership</a></li>
<li><a href="https://django.threadless.com/" target="_blank">Official merchandise store</a></li>
<li><a href="/foundation/donate/#benevity-giving">Benevity Workplace Giving Program</a></li>

@bmispelon
Copy link
Member

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 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants