Open MKorostoff opened 5 years ago
Your route is probably configured like this:
router.get('/mypage/', function (req, res) {
res.send('mypage');
});
This tells express (and the library) that your page is at /mypage/
and this is the main url, so it will add a trailing slash whenever somebody goes to the page /mypage
.
You should change your route to this:
router.get('/mypage', function (req, res) {
res.send('mypage');
});
This way express will think about it as /mypage
being the main url, so it will redirect /mypage/
to /mypage
. This should solve your problem.
Currently, this module redirects
/mypage
to/mypage/
. I'd like to do the reverse: redirect/mypage/
to/mypage
. I prefer this method because 1) historically a trailing slash signifies a directory and 2) I just like the look of it better. This could be implemented with a config option like: