Remove unnecessary URL parts/parameters

I’ve got a blog with article-urls like this

My old blog had URLs like this: etc.

When the article is valid but everything following it is unnecessary I would like to strip out parts and parameters after the URL.


or this

becomes this

Currently I’ve got a catch-all route which will redirect the user to the error-page

How can I strip out unnecessary parts?

Here’s the router.js I currently use for articles:

this.route('blog', { 'path' : 'blog/'}, function() {

  this.route('post', { 'path' : ':permalink' })
  this.route('not-found', { 'path' : 'not-found'})

// Error routes
this.route('not-found', { path : '/not-found'})
this.route('catch-all', { path : '/*path'})  // redirects to not-found