Remove unnecessary URL parts/parameters


#1

I’ve got a blog with article-urls like this http://ali.dj/blog/unlimited-fps-in-unity-editor

My old blog had URLs like this: http://ali.dj/blog/unlimited-fps-in-unity-editor/comment-page1 etc.

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

This http://ali.dj/blog/unlimited-fps-in-unity-editor/comment-page1

or this http://ali.dj/blog/unlimited-fps-in-unity-editor/comment-page1?ref=foo

becomes this http://ali.dj/blog/unlimited-fps-in-unity-editor

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