ebmdatalab / thedatalab

The Datalab's website
https://www.thedatalab.org
1 stars 1 forks source link

Handle missing trailing slashes in URLs #54

Open inglesp opened 3 years ago

inglesp commented 3 years ago

We should probably redirect requests to URLs without a trailing slash to URLs with a trailing slash.

inglesp commented 3 years ago

For instance, https://www.thedatalab.org/blog/2019/08/81/what-is-the-dmd-the-nhs-dictionary-of-medicines-and-devices gives a 404.

madwort commented 3 years ago

I added a redirect for just blog urls without trailing slashes recently (so your example link now redirects correctly), if you can assure me that all possible urls need a trailing slash then I can do it for all urls.

madwort commented 3 years ago

some urls respond with or without the slash (no redirect), e.g. https://www.thedatalab.org/openprescribing/papers vs https://www.thedatalab.org/openprescribing/papers/ and others (such as blog posts) 404

inglesp commented 3 years ago

I reckon https://github.com/ebmdatalab/thedatalab/blob/master/thedatalab/urls.py#L71 could do with a slash at the end.

madwort commented 3 years ago

aye it looks like it