A way to make custom 404 page for glitch website applications?

You can’t use a .htaccess file on Glitch. One way to do it is to use Express and set the last route to be one that catches everything that hasn’t already been handled by a route. So in https://glitch.com/edit/#!/simplistic-farmer for example, I have a route for ‘/’, the homepage, which renders: https://simplistic-farmer.glitch.me/ but if I try going to https://simplistic-farmer.glitch.me/gfdgdfgfdg it shows 404, because of the app.get('*' on line 19: https://glitch.com/edit/#!/simplistic-farmer?path=server.js:19:1

4 Likes