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

owning-a-home 404s caused by urls.py #7197

Closed
csebianlander opened this issue Aug 23, 2022 · 0 comments · Fixed by #7198
Closed

owning-a-home 404s caused by urls.py #7197

csebianlander opened this issue Aug 23, 2022 · 0 comments · Fixed by #7198

Comments

@csebianlander
Copy link
Contributor

There are three 404s in our latest analytics report that are caused by redirects set up within cfgov/cfgov/urls.py, rather than redirects.conf or the Wagtail admin panel:

  • /owning-a-home/resources/adjustable_rate_loan_estimate.pdf redirects to /static/owning-a-home/resources/adjustable_rate_loan_estimate.pdf
  • /owning-a-home/resources/mortgage_closing_forms.pdf redirects to /static/owning-a-home/resources/mortgage_closing_forms.pdf
  • /owning-a-home/resources/checklist_mortgage_closing.pdf redirects to /static/owning-a-home/resources/checklist_mortgage_closing.pdf

There are redirects set up in Wagtail for all six of these 404s, which should lead to these URL paths respectively:

The problem is that the redirects set up in Wagtail are being overriden by the wildcard operation in urls.py:

    re_path(
        r"^owning-a-home/resources/(?P<path>.*)$",
        RedirectView.as_view(
            url="/static/owning-a-home/resources/%(path)s", permanent=True
        ),
    ),

I do not know enough about the static assets that still exist within owning-a-home to know whether and to what degree this operation (which was set up back in 2016) is still necessary, but at a minimum I think we need to somehow make an exception for PDF files, which all should live on the files server at this point.

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

Successfully merging a pull request may close this issue.

1 participant