HomeQuestionsHow to Redirect 404 Errors to a Page in ExpressJS? How to Redirect 404 Errors to a Page in ExpressJS?By mohan / April 29, 2019 Discussion Room › Category: Coding › How to Redirect 404 Errors to a Page in ExpressJS? 0 Vote Up Vote Down mohan asked 6 years ago In server.js add the subsequent code to send 404 errors back to a page in our ExpressJS App: /* Define fallback route */ app.use(function(req, res, next) { res.status(404).json({errorCode: 404, errorMsg: “route not found”}); });