inket / dokku-buildpack-jekyll4-nginx

Jekyll 4 on Dokku
MIT License
15 stars 34 forks source link

Urls ending on a slash give 404 #6

Closed jeroenpelgrims closed 8 years ago

jeroenpelgrims commented 8 years ago

1: http://myblog.com/my-post-slug => works
2: http://myblog.com/my-post-slug/ => 404

Either the 2nd example url should redirect to the 1st example url or vice versa.

This line doesn't seem to catch all cases: try_files $uri $uri.html $uri/ =404; (conf/nginx.conf.erb)

In the 2nd case you'd try checking for the following files or folders: my-post-slug/ my-post-slug/.html my-post-slug//

All posts generated by jekyll are .html files.

jeroenpelgrims commented 8 years ago

I fixed this by adding a line which redirects urls with a trailing slash to the same url without a trailing slash in PR #7.