Adonis router 'strict match mode'
Brief history
By default Adonis router is case insensitive and doesn't respect trailing slash. Though Google and most other search engines treat URLs like:
- /Test
- /test
- /test/
- /Test/ as different urls and can index it as 4 urls, even though in reality it's the same page. This is not good in SEO point of view and can cause decrease positions in search engines result page.
What problem does it solve?
Prevent search engines from indexing duplicated content.
Proposal
I suggest Add config option to enable case 'sensitive matching' and 'strict mode'. I find out that Adonis internally use https://github.com/pillarjs/path-to-regexp this module for parsing urls, and it already has this two options out of the box.
Are you willing to work on it?
It's hard for me to find out how to correctly make options and pass it to '/src/Route/index.js' (if i'm not mistaken here is where we match urls with 'path-to-regexp') since I'm not good at OOP and advanced design patterns that Adonis uses. But I can update docs if needed
This sounds reasonable. I will look into it when working on the router. Thanks
two years have passed ;)
New to Adonisjs, but I'd also appreciate this functionality.