Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Make URLs work with or without trailing slash #5

Open
tylerdave opened this issue Feb 6, 2018 · 1 comment
Open

Make URLs work with or without trailing slash #5

tylerdave opened this issue Feb 6, 2018 · 1 comment

Comments

@tylerdave
Copy link
Member

In #4 we noticed that a link to a URL with a slash was returning a 404 while the URL without the slash was valid. Django has an APPEND_SLASH setting that would cause all URLs to have a trailing slash. I'd prefer the opposite. It seems this snippet does what we want:

https://djangosnippets.org/snippets/2655/

@befreeman
Copy link
Contributor

As an FYI - the above snippet works as expected, but there is a complication. Some of the Django app routes used by the site redirect URLs without a trailing slash to have a trailing slash and wind up in a non-terminating redirect loop.

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

No branches or pull requests

2 participants