With Express, how can I redirect all urls with "/something" to the base path "/:=" including additional paths to their respective pages. For example, I want to redirect the following:
- "/something" to "/"
- "/something/else" to "/else"
- "/something/else/again" to "/else/again"
- etc...
How can I achieve that with Express?
var express = require('express');
var router = express.Router();
router.get('/something/*', function(req, res) {
res.redirect('/');
});
module.exports = router;