diff --git a/app.js b/app.js index 81c5b16..8b36f2e 100644 --- a/app.js +++ b/app.js @@ -333,10 +333,15 @@ app.get('/rss', (req, res) => { res.send(rssFeed); }); - -// Global 404 handler for any other unmatched routes +// Global 404 handler for unmatched routes app.use((req, res) => { - res.redirect('/'); // Redirect to the home page for any 404 error + if (req.hostname === 'blog.raven-scott.fyi') { + // Redirect to the main domain + res.redirect('https://raven-scott.fyi'); + } else { + // Redirect to home page of the current domain + res.redirect('/'); + } }); // ================================