Skip to content

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

Open
@pbratkowski

Description

@pbratkowski

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

Activity

pbratkowski

pbratkowski commented on Jan 19, 2025

@pbratkowski
ContributorAuthor

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

changed the title [-]Broken links on Donate page[/-] [+]Broken links when using the footer from the Docs site[/+] on Jan 19, 2025
pbratkowski

pbratkowski commented on Jan 19, 2025

@pbratkowski
ContributorAuthor

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

bmispelon commented on Jan 20, 2025

@bmispelon
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 🤔

AhmedNassar7

AhmedNassar7 commented on Feb 8, 2025

@AhmedNassar7

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @bmispelon@AhmedNassar7@pbratkowski

      Issue actions

        Broken links when using the footer from the Docs site · Issue #1880 · django/djangoproject.com