Multiple dashes in URL causes 404

352 views Asked by At

Currently i'm rewriteting my titles to slug. But when i make a slug from a sentence with a dash in it. The dash is included in the slug.

So this Awesome Title - 2017 get's converted to the slug awesome-title---2017

I know it's a quick fix, but i was wondering why it's not a valid URL as it throws a 404 page.

Maybe it's related to the backbone history routing implementation,. which is implemented in the single-page-app.

The thing I can't explain, is that I use the slugs for the routing config, so it's feed with the url with the three dashes (http://website.com/fake-url---with-extra-dashes), but when going to the url it gives and 404 error, while the one without dashes (http://website.com/fake-url-with-extra-dashes) is working.

Are there some kind of automatic rewriting going on behind the scene in Backbone? or is the browser rewriting the url, because multiple dashes is invalid?

0

There are 0 answers