How to rederict after a 404

Hey! I created my own website! Now, I want to make a 404 error page! But if I use .htacces files, it, and I setted everyting up to my 404 page, it doesn’t redericts me! I searched a lot, but I was unable to find something!

I used the webpage option when I created it! I hope someone can assist me!

Kind Regards,

Hello,

To use an .htaccess file, you need to use the lamp-poc (Apache) project. What kind of project to you have right now?

I already fixed it, I switched to a express app! Thanks for helping me!

You can use an app.get("*" path to serve 404 files.

You should do that right after all your express code, or else everything will be 404. I learned that the hard way :wink:

3 Likes

Same… #tenchars

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.