cfpb / sheer

A tool for loading arbitrary content into Elasticsearch and serving that content on the web.
Creative Commons Zero v1.0 Universal
29 stars 23 forks source link

fix for trailing slash #58

Closed dpford closed 10 years ago

dpford commented 10 years ago

This MOSTLY fixes the problems we were having with trailing slashes. There is a corresponding change to sheer_blog's lookups.json required for this to work.

Previously, using a trailing slash on a URL created 404s (see #43)

Now, URLs without trailing slashes will be redirected to the trailing slash version. Going directly to the trailing slash version also works.

One known bug is that now a slash gets added to filenames as well, ie. typing in localhost:7000/blog/index.html turns into localhost:7000/blog/index.html/ (on the bright side, the page still loads).

So, while not yet a perfected solution, this is still much better than getting 404s when trailing slashes are used.

Scotchester commented 10 years ago

@rosskarchner Could you please review this?