Search code examples
meteoriron-router

Redirecting old URLs with iron router


i need to redirect an old URL (http://my-domain.com/details/detail-form.html) to a new URL (http://my-domain.com/details-form/) in my meteor app.

How can i define a second route like this? This is my current route:

Router.route('/details', function () {
   this.render('detail-form');
})

And this is what i want to add to my current route:

Router.route('/details/detail-form.html', function () {
   this.render('detail-form');
});

But iron router doesn't let me assign two routes to "detail-form".

Thanks


Solution

  • Make use of Router.go('<your-new-url>') in your old route function.