In my Koa app, I've this kind of router :
app
.use(router(app))
.all('/', frontRoutes.home.index);
My problem is that :
- mydomain.com
- mydomain.com/
- mydomain.com?
Are routed by the same route. It could be great but for Google it's not. Says that it's duplicate content. So I would like to redirect the first and third to the second. Like something to this :
app
.use(router(app))
.redirect('/\?', '/', 301)
.redirect('', '/', 301)
.all('/', frontRoutes.home.index);
Have tried some regexp without success. Already opened a Github issue but without answer too : https://github.com/alexmingoia/koa-router/issues/251 .
Thanks in advance for your help :)